正在删除AWS cognito JWT响应上的cognito:username



我正在使用AWS Cognito进行身份验证。而且,我正试图弄清楚是否有可能删除JWT的一个密钥,value?

cognito:username

典型的解码JWT将包含。

{
"sub": "aaaaaaaa-bbbb-cccc-dddd-example",
"aud": "xxxxxxxxxxxxexample",
"email_verified": true,
"token_use": "id",
"auth_time": 1500009400,
"iss": "https://cognito-idp.ap-southeast-2.amazonaws.com/ap-southeast-2_example",
"cognito:username": "exampleuser",
"exp": 1500013000,
"given_name": "Anaya",
"iat": 1500009400,
"email": "exampleuser@example.com"
}

基于此:https://aws.amazon.com/premiumsupport/knowledge-center/decode-verify-cognito-json-token/

我想删除accessToken上的cognito:username

只要检查选项,如果可以先通过cognito删除或隐藏,我的最后一个选项就是使用代码,也就是说,解析它,然后删除,然后再次编码。

感谢

cognito:username无法删除或修改。参考编号:https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-pre-token-generation.html

最新更新