ID token claims in AWS cognito


Here is the docode id token that i get from aws cognito after logging into website: { "member_id": "1480922", "sub": "11740962-fded-43c4-80b6-e511e82d54ce", "email_verified": true, "iss": "", "phone_number_verified": true, "cognito:username": "11740962-fded-43c4-80b6-e511e82d54ce", "origin_jti": "4c721793-99a5-440b-bd21-15ff63832c4a", "aud": "11b78mavj1gvtnm2roehb697u8", "event_id": "16f53eef-eeba-45ac-8284-90562846edaf", "token_use": "id", "auth_time": 1695712867, "is_subscribed": "true", "exp": 1695713166, "iat": 1695712867, "jti": "d945282e-eadd-4114-bafa-1bd276acc723" }

I want to removed claims like iss, event_id, token_use, cognito:username to make the token shorter. For this I tried to override these claims with none in my lambda function: event['response']['claimsOverrideDetails'] = { 'claimsToAddOrOverride': { 'cognito:username': None, 'token_use': None, 'iss': None, 'event_id': None } }

But i can still see the claims

asked 9 months ago610 views
1 Answer

No, you are not allowed to remove those claims. Claims that cannot be modified are mentioned in the following page.

profile picture
answered 9 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions