AuthorizationExternalApi. Android
Api to login to the app via external api.
Get external URL
See VMSBasicStatic
to know if you can login with external api use is_external_auth_enabled
.
Use this method to get direct url.
If request was successful you'll get url to load external service.
@GET(EXTERNAL_AUTH_URL)
suspend fun authUrlExternal(): VMSAuthUrlExternalResponse
External login
Login to your application.
@POST(EXTERNAL_AUTH_CALLBACK)
suspend fun callbackUrlExternal(@Body request: VMSExternalAuthCodeRequest): VMSLoginResponse
If request was successful you'll get VMSLoginResponse
object.
If you receive 419 error, that means you need to delete session. For that repeat this request with sessionId parameter that you can take from error. See ApiError details for that information.
@POST(EXTERNAL_AUTH_CALLBACK)
suspend fun callbackUrlExternalSession(@Body request: VMSExternalAuthCodeSessionRequest): VMSLoginResponse
VMSExternalAuthCodeRequest
Object with needed information for external login. You need either loginKey or code to be able to login.
code
- code needed to login
VMSExternalAuthCodeSessionRequest
key
- login key needed to login
sessionId
- session id you want to replace in case you receive 419 error. See ApiError
for mor details