Login with X credentials and logout. Trying to login with Y credentials, unable to login into okta.
This is the error response as the result of calling the authenticate method.
APIError : “Authorization Error: Unexpected response format while retrieving authorization code. Status code:200”
Here’s how I get the session token:
OktaAuthSdk.authenticate(with:{okta domain}, username: {user name}, password: {password}, onStatusChange: { (status) in
}) {(error) in
}
Access token is obtained like below and the failure happens here:
oidcClient.authenticate(withSessionToken: sessionToken, callback: {stateManager, error in
})
On logout
dClient.signOut(with: [.revokeAccessToken, .removeTokensFromStorage, .revokeRefreshToken, .revokeTokensOptions], authStateManager: stateManager, from: UIViewController()) { currentOption in
Assuming this is the SDK being used in a classic Okta Org.
This most likely means that an html page instead of Json is being returned.
This can happen if you have application level MFA setup for the application.
If the user has not logged into Okta before and needs to set their security question.
User not assigned to the app
etc
Since one user works and the other doesn’t check if one user is setup for application level MFA for this app. You might also try navigating to your Okta Org and logging in as the user to see if the need to fill out an initial security question, or setup MFA if they have never logged in before.