问题
So I've implemented Amazon Cognito login on an iOS app in Swift and it all works great. However I'm now trying to find out the groups that a logged in user belongs to. I can't seem to find a good way of doing this from within the app. The SDK doesn't seem to provide a way of doing so from what I can see. Any help would be much appreciated!
回答1:
Currently the groups are exposed in the ID token issued to the user. It is populated in claim "cognito:groups". More details here: http://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-user-groups.html
来源:https://stackoverflow.com/questions/45524882/aws-cognito-get-user-group-in-swift