-
Notifications
You must be signed in to change notification settings - Fork 111
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
fix(auth): Fix for when alias is used to sign in and deviceKey is stored with the entered username instead of retrieved username #2614
Conversation
Codecov Report
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. @@ Coverage Diff @@
## main #2614 +/- ##
==========================================
- Coverage 41.71% 41.71% -0.01%
==========================================
Files 900 900
Lines 28852 28865 +13
Branches 4098 4104 +6
==========================================
+ Hits 12037 12040 +3
- Misses 15491 15497 +6
- Partials 1324 1328 +4 |
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.
1 comment suggestion but otherwise good.
aws-auth-cognito/src/main/java/com/amplifyframework/auth/cognito/helpers/AuthHelper.kt
Show resolved
Hide resolved
aws-auth-cognito/src/main/java/com/amplifyframework/auth/cognito/actions/SRPCognitoActions.kt
Outdated
Show resolved
Hide resolved
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.
See comment on deviceMetadata
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.
LGTM!
Issue #, if available: #2609
Description of changes:
When a user signs in with their alias instead of a username and the userpool is not configured to sign in with username, cognito assigns a username to that user (generally a generated UUID). However this breaks the current flow in a way that device ID gets generated each time as there is no stored device information for the new generated username for when we have to do respondToAuthChallenge we use the username returned from the service and not the username that was entered by the user.
This PR will fix that flow for Custom Auth (with/without SRP and SRP).
Important to note:
This fix does not fix device tracking for when AuthFlow is
USER_PASSWORD_AUTH
as InitiateAuth in user_password_auth does not have access to deviceTracking.How did you test these changes?
(Please add a line here how the changes were tested)
Documentation update required?
General Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.