-
Notifications
You must be signed in to change notification settings - Fork 119
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
After remembering device, calling Amplify.Auth.signOut() causes next signIn() call to return CONFIRM_SIGN_IN_WITH_SMS_MFA_CODE #2295
Comments
Hello @TylerMcCraw, thank you for reaching out! Have you enabled |
Yes, we have. Devices are being remembered. And if a session timeout happens, which causes our sign-in screen to show, then on subsequent signin calls the user isn't required to be challenged (i.e. their next step is DONE). |
This issue is causing a serious detriment to our user experience and negates our ability to remember devices. Could we better understand what may need to be done to fix this? It seems like the device credential is getting cleared here: Line 95 in 48e294b
But, I'm not sure if this is the cause of this particular issue. |
I've had our iOS team verify if this behavior is similar with using the amplify-swift library. |
@TylerMcCraw Thanks for the update. We are working to reproduce this issue on our end so that we can determine the root cause. |
@TylerMcCraw We were not able to replicate the issue. Some more info would help us debug this if this is still an issue for you.
|
|
Can you enable the Android debugger Paste the logs here with sensitive info removed. This would help us understand the issue better and reproduce it. |
@div5yesh I'll get logs to you asap! |
@div5yesh I've got a working reproduction of the issue with this project that I created for you here: https://github.com/TylerMcCraw/androidamplifyissue. |
@div5yesh @tylerjroach Hoping to ping you here so you know that there's a working project I posted above to reproduce this issue. The Issue has a |
@TylerMcCraw Thanks for the ping. I know Divyesh has his own sample app that he was attempting to replicate this. We can investigate the sample provided to see if there are any differences that stand out. In the meantime, the easiest way to investigate this issue may still be to provide the logs that @div5yesh requested so we can see exactly what is happening on your devices. It's possible the issue could exist in the service configuration and we may still not be able to easily replicate with the sample. |
@tylerjroach @div5yesh Particularly, at this line of code. So, the lookup from EncryptedSharedPreferences via To sum it up, looking up the device key with "[email protected]" returns null because the device key is stored with "7n1h6e06-7503-4b21-80ad-d52ae3769dv8", therefore Amplify can't fetch the device key and therefore Amplify responds with a challenge step every time requiring the user to enter their 2FA code. Possible SolutionIf amplify-android were to use the AWS username UUID to look up the device metadata here instead of the username that's passed along from the |
@TylerMcCraw Thanks for the deep dive. 🙌 |
If you all could help me figure out a way to fetch the username UUID string that corresponds to the user attempting to signin with their username(non-UUID string)/password as described in the possible solution I mentioned above, then I'll put up a PR for this fix. |
@div5yesh Is there any news from this? Or you can put a specific line of code and I can edit my sdk for hotfix? |
I am also having the same problem as above, remembering the device on android is successful, but the next time I enter it, it still goes to the sms case |
@TylerMcCraw Do you have any workaround solution for this case? |
Unfortunately I'm also trying different methods and it still doesn't work, I see that every time I remember on the same machine, the device key is different. |
@nautilux2
|
thanks you, I will try |
it was work, thanks you @tylerjroach , @nautilux2 |
|
@gpanshu why was this ticket closed? |
i have called forget device function on my device but it failed error saying device key is null |
@TylerMcCraw This is the location in the code where user's device metadata is stored with Feel free to create a PR for any possible solution you have in mind. |
|
Before opening, please confirm:
Language and Async Model
Kotlin - Coroutines
Amplify Categories
Authentication
Gradle script dependencies
Environment information
Describe the bug
If Amplify.Auth.rememberDevice() is called after confirmSignIn(), then I would expect that the device would be remembered and the user would not be challenged for MFA if they were to sign out and sign back in.
Currently, if a device is set to be remembered after a user confirms signin and then they sign out and sign in again, we receive a
CONFIRM_SIGN_IN_WITH_SMS_MFA_CODE
as the signIn() call'snextStep.signInStep
. Unless I'm misunderstanding the expected outcome of asignOut()
call, I think the user should be receivingDONE
as thenextStep.signInStep
Reproduction steps (if applicable)
Amplify.Auth.signIn(username, password)
. Result should returnCONFIRM_SIGN_IN_WITH_SMS_MFA_CODE
as next stepAmplify.Auth.confirmSignIn(code)
. Result should returnDONE
as next stepAmplify.Auth.rememberDevice()
Amplify.Auth.signOut(options = AuthSignOutOptions.builder().globalSignOut(false).build())
Amplify.Auth.signIn(username, password)
. Result returnsCONFIRM_SIGN_IN_WITH_SMS_MFA_CODE
again as next step. Result should have returnedDONE
🐛amplifyconfiguration.json
The text was updated successfully, but these errors were encountered: