AWS Cognito在Swift中获得用户组 [英] AWS Cognito get User Group in Swift
问题描述
因此,我已经在Swift中的iOS应用上实现了Amazon Cognito登录,并且一切正常。但是,我现在试图找出已登录用户所属的组。我似乎找不到从应用程序中执行此操作的好方法。据我所见,SDK似乎没有提供这样做的方法。任何帮助将不胜感激!
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!
推荐答案
当前,这些组在发布给用户的ID令牌中公开。
它填充在声明 cognito:groups中。
此处有更多详细信息: http://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-user-groups.html
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
这篇关于AWS Cognito在Swift中获得用户组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!