tl;dr:
What is the purpose of being able to add users to multiple groups in a user pool if the group with higher precedence overrides the role of the group with lower precedence? (Instead of stacking the roles)
Situation:
Cognito user pool with 2 groups. Group 'A' has a role with full access to Dynamo with a precedence of 10 Group 'B' has a role with full access to Elastic Search with a precedence of 9
If I add a user to either group alone it works as expected.
However
I assumed the purpose of being able to add users to multiple groups would be to have the roles stack instead of overwrite. This way...:
Could result like so:
But in reality: - Someone in A and B has perms 4,5,6 - Someone in A, B, and C has no permissions
A user pool is a user directory in Amazon Cognito. With a user pool, your users can sign in to your web or mobile app through Amazon Cognito. Your users can also sign in through social identity providers like Google, Facebook, Amazon, or Apple, and through SAML identity providers.
With a user pool, your app users can sign in through the user pool or federate through a third-party identity provider (IdP). Identity pools are for authorization (access control). You can use identity pools to create unique identities for users and give them access to other AWS services.
Each user pool can contain up to 25 groups. Additionally, you can add users and remove users from groups within a user pool, and you can use groups to control permissions to access your resources in AWS by assigning an AWS IAM roles for the groups.
Short description. You can't change standard user pool attributes after a user pool is created. Instead, create a new user pool with the attributes that you want to require for user registration. Then, migrate existing users to the new user pool by using an AWS Lambda function as a user migration trigger.
It is expected behavior. If you want permissions from both of the groups you'll just have to create another group/role with combined permissions. Groups are for separating users. At any time a user can assume only one role. You can either let cognito decide which role it will assume based on precedence or you can specify it in GetCredentialsForIdentity custom role ARN. Also you can switch between roles behind the scenes whenever you want by calling GetCredentialsForIdentity and switching the role ARN and Make calls using the credentials for specific role.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With