Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MFA authentication with sessionToken broken #285

Open
programmarchy opened this issue Apr 6, 2021 · 10 comments
Open

MFA authentication with sessionToken broken #285

programmarchy opened this issue Apr 6, 2021 · 10 comments
Assignees
Labels

Comments

@programmarchy
Copy link

It does not seem possible to authenticate with MFA using okta-auth-swift and okta-oidc-ios.

I'm able to get a sessionToken after successfully verifying MFA with a passcode (using Google Authenticator), but then the subsequent call to OktaOidc.authenticate(withSessionToken:) fails with the following error:

"Authorization Error: Unexpected response format while retrieving authorization code."

To replicate these steps:

  • Clone https://github.com/okta/samples-ios/tree/master/custom-sign-in
  • Update Okta.plist
  • Update Okta domain
  • Run the app; notice you can "Sign In" but stateManager is nil and error is set to message above.

I have the following settings configured:

1-google-auth-enabled
2-app-level-auth
3-org-level-auth

@laura-rodriguez
Copy link

Hi @programmarchy,

Thanks for your question! I'm going to assign this to someone on our team who can help with this library.

@laura-rodriguez
Copy link

Internal ref: OKTA-385140

@programmarchy
Copy link
Author

@laura-rodriguez I have some additional information that may be helpful. Here's where the error is created:

Screen Shot 2021-04-06 at 3 26 35 PM

@programmarchy
Copy link
Author

@laura-rodriguez Another update --

If I delete my app-level MFA sign on rule, and leave only the org-level sign on rule, then things work as expected.

@oleggnidets-okta
Copy link
Contributor

@programmarchy What is defined in Multifactor -> Factor Enrollment. Have you added there some custom rule?

@programmarchy
Copy link
Author

@oleggnidets-okta I'm pretty sure I had set "Google Authenticator" to "Required" for enrollment, but I actually can't double check that currently because I managed to lock out all of my users (including admin) during testing.

@oleggnidets-okta
Copy link
Contributor

Never mind, I can reproduce the issue. Now I should bring up and discuss this issue to our team.

@oleggnidets-okta
Copy link
Contributor

Hi @programmarchy @bdruth,
I have discussed the issue with team and a guy who developed OktaAuthSdk.

Indeed, there's no way to intercept MFA challenge when you exchange sessionToken. OIDC does the silent exchange and this is the whole idea. If you want to handle MFA on app level then you should switch to SIW (sign-in widget) flow.

The solution is deleting app-level MFA sign-on rule and leave only the Org-level sign-on rule.

Related Android issue.

@programmarchy
Copy link
Author

@oleggnidets-okta Thanks. It would be helpful if the Okta documentation clearly explained this, and it seems like the Okta admin interface should disable or at least present the user a warning when adding an app-level MFA rule for OIDC providers.

@ahujamanish
Copy link

@programmarchy I'm facing a similar issue. I don't see I've any app-level rule added, but I might be wrong. Can you help me understand how to add an org-level rule and remove any app-level rules? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants