Custom attribute not passed into ID_TOKEN created by AWS Cognito

前端 未结 2 904
孤街浪徒
孤街浪徒 2021-02-07 06:01

I am not able to get custom attribute in ID_TOKEN returned from AWS Cognito after successful user login.

Steps I tried :

1.Created user pool 2.C

相关标签:
2条回答
  • 2021-02-07 06:12

    I had the same trouble and your question came up when I was searching for a solution.

    My custom attributes started to appear in ID token when I enabled profile scope in 'App client settings'. (available at: AWS console-> 'User pools'-> click your pool -> 'App client settings' -> 'Allowed OAuth Scopes')

    (BTW: I was misled by this sentence from the documentation: "The openid scope returns all user attributes in the ID token that are readable by the client". In my case openid scope was not enough.)

    0 讨论(0)
  • 2021-02-07 06:26
    • In your Cognito user pool go to General Settings -> App Clients, then for each app client click on Show Details, then Set attribute read and write permissions. Check the checkbox next to your attribute name under Readable Attributes.
    • In your Cognito user pool go to App client settings -> Allowed OAuth Scopes and enable profile scope.
    0 讨论(0)
提交回复
热议问题