我的应用为每个新注册用户创建了一个自定义属性userType".现在,我希望在用户登录或令牌刷新时将此userType"声明/属性添加到 JWT 访问令牌中.
My app creates a custom attribute "userType" for each new signed-up user. Now I would like this "userType" claim/attribute to be added to the JWT access token whenever the user signs in or the token gets refreshed.
是否可以选择告诉 Cognito 将我的自定义声明/属性添加到 JWT 访问令牌?(没有预令牌生成 Lambda)
Is there an option to tell cognito to add my custom claim/attribute to the JWT access token? (Without a pre token generation Lambda)
推荐答案自定义属性在 Cognito 访问令牌中不可用.目前无法使用 预令牌生成 Lambda 触发器.PreToken Generation Lambda Trigger 仅允许您自定义身份令牌(Id Token)声明.
Custom attributes are not available in Cognito access token. Currently it is not possible to inject additional claims in Access Token using Pre Token Generation Lambda Trigger as well. PreToken Generation Lambda Trigger allows you to customize identity token(Id Token) claims only.
更多推荐
AWS Cognito:向 JWT 访问令牌添加自定义声明/属性
发布评论