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
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
cognito:groups