It worked yesterday.
It worked yesterday.

Reputation: 4627

AWS Cognito Custom attribute is missing from ID token

I have a cognito userpool with a custom attribute. Attribute is mutable and the type is Boolean. But it is missing from the ID token

I tried following things

None of them worked. How do I add custom attributes to the ID token?

Upvotes: 2

Views: 2800

Answers (1)

It worked yesterday.
It worked yesterday.

Reputation: 4627

Finally found a fix for this

In my case, I did not receive the attribute as it did not contain any value. The attribute will only be included in the token only if it contains a value

Important points found on research:

  • Make sure your attribute is readable. You can do this by visiting App clients -> Show details -> Set attribute read and write permissions (Insignificant link in the bottom.) -> tick your attribute that you want to be included in the token

  • If you are adding the attribute to an existing user pool, then you can not make it required.

Upvotes: 3

Related Questions