aws / aws-aspnet-cognito-identity-provider

ASP.NET Core Identity Provider for Amazon Cognito
https://aws.amazon.com/developer/language/net/
Apache License 2.0
213 stars 89 forks source link

How to retrieve the list of all roles (groups) #212

Closed stringit-mcagno closed 2 years ago

stringit-mcagno commented 2 years ago

By following the documentation at https://github.com/aws/aws-aspnet-cognito-identity-provider/blob/master/docs/7-User%20Roles.md about managing roles, there's no indication about getting the list of all roles (groups). I mean not only the ones assigned to a user, but the list of all roles in general.

I tried to use the original RoleManager, but when you access the Roles property, it returns an exception since the store doesn't implement the interface IQueryableRoleStore<>.

What's the right way to get the list of all roles by using the class of this repo?

This is a :question: general question

ashishdhingra commented 2 years ago

Hi @stringit-mcagno,

Good afternoon.

Thanks for posting guidance question. You might be right that this library does not support getting Cognito User pool groups out of the box. As a workaround, you might want to consume AWSSDK.CognitoIdentityProvider package directly and use AmazonCognitoIdentityProviderClient.ListGroupsAsync() to list the groups associated with a user pool.

Thanks, Ashish

github-actions[bot] commented 2 years ago

This issue has not received a response in 5 days. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled.

github-actions[bot] commented 2 years ago

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.