Before opening, please confirm:
Language and Async Model
Not applicable
Amplify Categories
Authentication
Gradle script dependencies
Details
// Put output below this line
Environment information
Details
# Put output below this line
Please include any relevant guides or documentation you're referencing
No response
Describe the bug
If you sign in to a user using an email address (or phone number) as the sign in attribute when using the USER_AUTH flow then when you call Amplify.Auth.getCurrentUser().username the value returned will be the attribute to used to sign in. With all other flows the value returned is the actual username.
Reproduction steps (if applicable)
- User a userpool with email and/or phonenumber as a sign in attribute. Have USER_AUTH and USER_SRP_AUTH both enabled in the app client.
- Use an email address (or phone number) to sign in with a created user via the USER_AUTH flow.
- Call
getCurrentUser() and observe the username.
- Sign out
- Sign in to the same user using USER_SRP_AUTH.
- Call
getCurrentUser() and observe the username.
Expected: The username is the same in both cases since it's the same user.
Actual: In USER_AUTH the username is reported as the email address, in USER_SRP_AUTH it's the username (which may be a UUID if no username was supplied at sign up).
Code Snippet
// Put your code below this line.
Log output
Details
// Put your logs below this line
Configuration File
No response
GraphQL Schema
Details
// Put your schema below this line
Additional information and screenshots
No response
Before opening, please confirm:
Language and Async Model
Not applicable
Amplify Categories
Authentication
Gradle script dependencies
Details
// Put output below this lineEnvironment information
Details
Please include any relevant guides or documentation you're referencing
No response
Describe the bug
If you sign in to a user using an email address (or phone number) as the sign in attribute when using the USER_AUTH flow then when you call
Amplify.Auth.getCurrentUser().usernamethe value returned will be the attribute to used to sign in. With all other flows the value returned is the actual username.Reproduction steps (if applicable)
getCurrentUser()and observe theusername.getCurrentUser()and observe theusername.Expected: The username is the same in both cases since it's the same user.
Actual: In USER_AUTH the username is reported as the email address, in USER_SRP_AUTH it's the username (which may be a UUID if no username was supplied at sign up).
Code Snippet
// Put your code below this line.Log output
Details
Configuration File
No response
GraphQL Schema
Details
Additional information and screenshots
No response