我的应用为每个新注册用户创建了一个自定义属性"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令牌)声明.
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访问令牌添加自定义声明/属性
发布评论