How do I access the group for a Cognito User account?

后端 未结 7 791
情话喂你
情话喂你 2020-12-14 00:54

In AWS Cognito, you can add a user to a group (after first creating a group). A user may belong to one or more groups.

With using the JavaScript SDK (https://github

7条回答
  •  南笙
    南笙 (楼主)
    2020-12-14 01:43

    You can now easily get the user groups from the user session:

    session.getIdToken().decodePayload();

    This contains an array of groups in the cognito:groups key returned

提交回复
热议问题