Amplify gen2 - User added to default Group by, assumes only Group Role, does not assume amplifyAuthauthenticatedUser Role #1985
Labels
duplicate
This issue or pull request already exists
pending-triage
Incoming issues that need categorization
How did you install the Amplify CLI?
npm
If applicable, what version of Node.js are you using?
21.6.2
Amplify CLI Version
12.9.0
What operating system are you using?
mac
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
No manual changes made
Describe the bug
Using Amplify Gen2
User Signup flow - adds user to a ["DEFAULTGROUP"] by post-confirmation function.
On AWS IAM, There is a GROUP - IAM Role that's created.
Also there is a amplifyAuthauthenticatedUser - IAM Role that exist.
In AWS Storage, if we have access control to let user to read/write/delete files
'upload-user/{entity_id}/*':[
allow.entity('identity').to(["read","write","delete"])
],
and another storage location where Group Users can read/write/delete files
'upload-group/*':[
allow.groups(['DEFAULTGROUP']).to(['read','write','delete']),
]
Once user is authenticated, they only assume the IAM Role of DEFAULT GROUP, hence they are able to read/write/delete only on the upload-group/*
They need to assume the amplifyAuthauthenticatedUser* in order to be able to write into upload-user/{entity_id}/
The ID Token shows only one role which is the DefaultGroups IAM Role, and no other role.
Expected behavior
Once user is authenticated, as they belong to DEFAULTGROUP, they should be able to write into both upload-user/{entity_id}/* and upload-group/*
Reproduction steps
Project Identifier
No response
Log output
Additional information
No response
Before submitting, please confirm:
The text was updated successfully, but these errors were encountered: