Hello everyone. Currently, I configured a custom login provider, in my case I have configured it with Okta, in my understanding is that with a login provider, I might use backendless SDK for authenticating my users in Okta, how can I implement iOS SDK backendless with different login provider? I’m trying with okta auth 2 authentication methods Backendless iOS SDK. Bellow is my current provider configuration:
My okta configuration is working well, I’m authenticating my user correctly, but in the sequence when I try to connect with backendless provider, sending access params, connections appear to fail.
This is my login mechanism step by step
func login() -> Promise<Void> {
return Promise<Void> { [unowned self] (resolve: @escaping () -> Void, reject) in
self.userStore.loginOkta().then { oktaStatus in
guard let sessionToken = oktaStatus.model.sessionToken else { return }
self.userStore.logInWithAuth2Client(sessionToken: sessionToken, completion: { manager in
print(manager) <- This is fine
guard let accessToken = manager.accessToken else { return }
self.userStore.loginWithAuth2Backendless(accessToken: accessToken).then { user in
print(user) <- Error
}
})
}
}
}
Request
Backendless.shared.userService.loginWithOauth2(
providerCode: "okta",
accessToken: accessToken,
fieldsMapping: [:],
stayLoggedIn: true,
responseHandler: responseHandler,
errorHandler: errorHandler)
Error
Error Domain=BackendlessErrorDomain Code=3109 "GUID: 638FA692-E155-6C52-FFF2-B6DD9C19B900
Error during obtaining user data.
Response from OAuth2 provider server: Bad Request
" UserInfo={NSLocalizedDescription=GUID: 638FA692-E155-6C52-FFF2-B6DD9C19B900
Error during obtaining user data.
Response from OAuth2 provider server: Bad Request
}
Backendless Version 6.6
Client SDK iOS
Expected Behavior
- Login with okta (success)
- Okta retrieves the access token
- Login with Backendless with a valid access token using the auth2 authentication system
- Login provider configured will validate access token with okta
- Okta will respond with success or error
- Backendless provider will respond with a valid authenticated user
Actual Behavior
Please provide a description of what actually happens, working from the same starting point.
Be descriptive: “it doesn’t work” does not describe what the behavior actually is – instead, say “the request returns a 400 error with message XXX”. Copy and paste your logs, and include any URLs.
- Login with okta (success)
- Okta retrieves the access token
- Login with Backendless with a valid access token using the auth2 authentication system (Here is the error)
Greetings!!