-
Notifications
You must be signed in to change notification settings - Fork 891
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
AWSMobileClient doesn't persist Session during CustomAuth #2616
Comments
Hey @srgray Thanks for reaching out. At the moment, I believe that we do not plan to support this use case for our authentication flows. As a user of a native iOS application, if the app crashes between entering my credentials and a custom auth challenge I would expect that when I re-launch the application that I would have to re-enter my credentials. Right? Similarly, I would expect this behavior if I were attempting to log into a website via a browser which required 2FA, right? |
Yes, I understand your reasoning. |
Thank you so much for taking the time to explain to us your use case! I now understand why you’d want such a feature, and it makes sense, but in talking with the team, I don’t expect us to pick up this feature any time soon for AWSMobileClient, if ever. As a workaround, we brainstormed around how you’d be able to work around this. To summarize your system design for Custom Auth (and please correct me if I’m wrong):
The problem occurs because in Step 4, the app may have been backgrounded too long, or the app crashes, etc.. So, as a work around, in Step 4, AFTER parsing the payload, we could:
I think this approach will work, and best of luck! Let us know how it goes! Thanks again! |
Thank you for the suggested workaround. We are going to try this out and I will report back. |
@srgray did any of the workarounds work? |
We weren't able to get this workaround working. The main issue is that we couldn't get AWS Cognito backend to make the connection between the first and second calls to |
Thanks for opening this issue. We recommend using the Auth category in Amplify Swift for this -- for more information, please visit https://docs.amplify.aws/swift/build-a-backend/auth/sign-in-custom-flow/ |
Describe the bug
If a CustomAuth flow is interrupted (by an app restart, e.g.), the CustomAuth flow cannot be completed successfully
To Reproduce
Steps to reproduce the behavior:
AWSMobileClient.default().signIn(username: username, password: "dummyPassword")
AWSMobileClient.default().confirmSignIn(challengeResponse: "<Challenge Response>"...
Observed Behavior
AWSMobileClient returns error 'Please call
signIn
before calling this method.'Expected Behavior
AWSMobileClient should be able to continue/complete the original call to
signIn
. Maybe the Session needs to be persisted, instead of kept in memory?Unique Configuration
Areas of the SDK you are using (AWSMobileClient, Cognito, Pinpoint, IoT, etc)?
AWSMobileClient
Environment(please complete the following information):
Device Information (please complete the following information):
Relevant Console Output
The text was updated successfully, but these errors were encountered: