代码之家  ›  专栏  ›  技术社区  ›  Mahesh_Loya

自定义属性未传递到AWS Cognito创建的ID_令牌中

  •  0
  • Mahesh_Loya  · 技术社区  · 7 年前

    我不能得到 标识符中的自定义属性

    1.创建用户池 customattrib1,customattrib2 )

    用户池屏幕:

    enter image description here

    检查应用程序客户端配置中的自定义属性

    enter image description here

    3.使用管理创建用户api创建用户

    enter image description here

    身份证

    {
      "at_hash": "PKfjYDaiEty5mUOyJZlPQA",
      "sub": "639d5016-2bd3-4c6f-b82d-21ae38071b09",
      "email_verified": true,
      "iss": "https://cognito-idp.ap-south-1.amazonaws.com/ap-south-1_XXXXXXX",
      "phone_number_verified": true,
      "cognito:username": "testuser",
      "aud": "XYXYXYXYX",
      "token_use": "id",
      "auth_time": 1549349674,
      "phone_number": "##########",
      "exp": 1549353274,
      "iat": 1549349674,
      "email": "testuser@somedomain.com"
    }
    

    我已经检查了下面的链接,其中有一些关于这个问题的信息,但到目前为止没有任何帮助。

    Adding Cognito custom attributes post pool creation?

    Cognito User Pool custom attributes do not show up in the ID token if user pool is configured with a SAML identity provider

    https://www.reddit.com/r/aws/comments/a07dwg/cognito_add_custom_attribute_to_jwt_token/

    请帮我弄清楚我是否遗漏了什么。。

    0 回复  |  直到 7 年前
        1
  •  9
  •   joe    6 年前
    • Show Details ,那么 Set attribute read and write permissions . 选中下属性名旁边的复选框 Readable Attributes .
    • profile
        2
  •  6
  •   JacekS    7 年前

    我也遇到了同样的麻烦,你的问题是在我寻找解决办法时提出来的。

    轮廓 “应用程序客户端设置”中的作用域。(可从以下位置获得:AWS控制台->用户池->单击您的池->应用程序客户端设置->允许的OAuth作用域')

    documentation :“那个 scope返回ID令牌中客户端可读取的所有用户属性”。对我来说 开放ID

    推荐文章