-
Notifications
You must be signed in to change notification settings - Fork 82
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
Enable MFA support for OIDC conformant clients #451
Conversation
"It's based on a still not released library, so tests will fail 💃" ? This old I presume as your tests all pass. |
Also noticed no CodeCov in this repo? |
@@ -169,6 +170,38 @@ public void shouldCallLegacyDatabaseLoginWithVerificationCode() throws Exception | |||
assertThat(reqParams, hasEntry("mfa_code", "123456")); | |||
} | |||
|
|||
@Test | |||
public void shouldCallOIDCDatabaseLoginWithOTPCodeAndMFAToken() throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one test? What about Login with OTP but no token etc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those cases are already tested on the auth0.android
SDK. There's no scenario where OTP is defined but the Token is not. If you're looking for the "legacy mfa" behavior check the test right above this one. https://github.com/auth0/Lock.Android/pull/451/files#diff-d3f9a8a9ba90477d9b0ffd039c4faf4cR152
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then LGTM
OIDC conformant clients were not able to authenticate after an mfa challenge was requested. This PR adds support for them. I also enhanced the errors that we display in the widget.
For legacy mode:
For OIDC mode:
This might change once theUsers will see a "THE USER HAS NOT ENROLLED MULTIFACTOR AUTHENTICATION" message.association_required
error is introduced to the API.mfa_token
lasts 10 minutes. If it expires, the user needs to retry the authentication from the beginning. So an expired MFA token will take the user back to the "username / password" form and display a "THE CODE IS INVALID OR HAS EXPIRED" message.General notes about this PR:
- It's based on a still not released library, so tests will fail 💃-> auth0/Auth0.Android#146/ro
sending again theemail/username
,password
andmfa_code
(the OTP) values./oauth/token
first with the password grant, which will fail due to "mfa_required" and will include anmfa_token
value. A second call is required on/oauth/token
this time with mfa-otp grant and the previousmfa_token
value along with theotp
code given by the user obtained from the 2FA/MFA app.