-
Notifications
You must be signed in to change notification settings - Fork 73
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
ID token does not include attributes such as given_name, family_name, or preferred_username #360
Comments
The PR I've just opened resolved the issue around the given_name and family_name for us (and it could be updated to add the preferred_username as well). Could do with some guidance on whether this is deemed the correct fix and recommendations on what the new tests should look like. |
Maybe there is a better way. In cognito it might make sense to make any read, or write, attributes available in the payload |
I agree, that was more a hack that worked enough for me to continue with some local testing
That seems sensible, although I think in AWS Cognito the attributes present on the token depend on which ones the client used to get token has access to read? So it seems that for accurate emulation we want to get the client and find out which ones it has access to, and also potentially add in any default ones that are always present from Cognito. Just need to investigate to confirm which ones (if any) should always be present. |
Thanks for investigating this @alec-w, I think your assessment is correct that the Client would factor into which attributes should be included in the tokens. The CreateUserPoolClient docs aren't especially helpful (as usual for Cognito), the Based off that, I think we should:
* I'm assuming an attribute present in If you're able to update your PR @alec-w to do this that would be amazing, otherwise I'll get to this when I can. |
@alec-w @jagregory I too require this functionality for my application.
I then manually added the optional field Available Default AttrsThese are the list of attribute read and write that I can modify from my client:
Write-Only Attrs
I unchecked Next StepsWould it be helpful to run the command below, to get what is listed in aws cognito-idp describe-user-pool-client |
Based on the bold text, I think these steps should be implemented (augmented from @jagregory)
|
The ID Token does not include attributes such as given_name, family_name, or preferred_username even though they exist on the user.
Decoded ID token:
Example user in local_ db file
Commands for setup and generating token:
The text was updated successfully, but these errors were encountered: