-
Notifications
You must be signed in to change notification settings - Fork 116
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
Auth: Error on Confirm Sign In after Sign Out #962
Comments
Any help please ? |
Yes |
Any help please ? |
Hey, sorry we left you hanging here - investigating now. |
Issue 1 - Amplify confirmSignIn doesn't work but AWSMobileClient confirmSignIn does. Looking at the code, I'll bet you're calling AWSMobileClient's I believe all we need to do is add that Issue 2 - The first SMS code you received when signing in after having signed out doesn't work but the second SMS code you received upon attempting to sign in a second time does work. Given you are doing custom auth, I expect the error lies on the side of your custom lambda code. As far as a SMS code working or not, that lies outside the scope of what our client does. Given that you are apparently sending an SMS code in your lambda on sign in, it's proper that the client is returning a status of I recommend digging into how you have the custom lambda code setup to see if you are doing things properly there. |
Hi @TrekSoft , ty for jumping in. On Issue 1, yes what you are saying it makes sense. I think we should at least get the option to tell Amplify which of the two methods to use based on the type of parameters received. Do you think is this something that will be tackled soon? On Issue 2, trust me I have dig deep into the process. And the issue only only happens after I request Amplify to sign out. Before that, on a fresh install of my app the SMS flow never breaks. Because the logs in my lambdas show that the code entered is good and it the auth is successful, returning tokens....right after that it sends a new custom challenge request...so I am thinking the AWS/Amplify sdk is kind of restarting or sending a request for a new custom challenge, even though seconds before it succeeded on the auth flow. The two steps that I have framed in the red square is where I believe there is some issue. |
That's what I'm saying though - the part you highlighted in red has no interaction with the client. That's all communication between User Pools and other parts of the AWS system. From what I understand your current issue is the following:
Can you carefully review those steps above and make sure that is an accurate timeline of your issue? |
Noting that this appears to be related to #805 |
Fixed by aws-amplify/aws-sdk-android#2316 |
Here's the flow I'm following:
I request sign-in with an email and a null password, to get the SMS code through the Cognito lambdas:
First time I sign-in, everything works perfectly. I get the SMS and enter the code and confirmed sign in successfully.
In order for this to work I do the code confirmation through
AWSMobileClient
directly, because Amplify's method of confirming the user code does not work:Will give this error:
But if I use
AwsMobileClient.confirmSignIn(code)
, it works fine.Then I perform an
Amplify.Auth.signOut()
. If I try to sign-in right after, I get the SMS code -- but the confirm-sign-in replies with 'CustomChallenge' instead of 'Done', and even sends a new SMS code. That new code does not work either. I navigate back to my email input screen and try a sign-in again, get a new sms code, and this time the sign in confirmation works perfectly.But I can't release this app with a bug telling the users that if they sign out, then the first time they'll try to sign-in again it will not work, to just try again. Maybe, there is something going on in the sign-out that is not clearing the user state or event session with Cognito properly. I have already tried deleting all the shared preferences XML files from the app on the sign-out, but its makes no difference.
I am using this Gradle configurations:
The text was updated successfully, but these errors were encountered: