I use temporary sessions in Amazon S3 with GetSessionToken / GetFederationToken, I plan to have more than 10 thousand users, each of which can be loaded on S3, so I decided to use a bucket for each user and set write permissions (upload) per bucket for each user , but since there is a limit on the number of buckets per Amazon account, I abandoned this idea.
How can I set permission, for example, allow public reading and load only if the prefix is ββon the key of the object that the user wants to download?
For example, if username X is loading a file, the key should be like X_filename.
Or in any other way that allows me to have security, this is for a mobile application, and I would not want to go through our own servers when downloading a file.
Edit:
I tried the GetFederationToken operation with the following policy
"{ "Statement":[{ "Effect":"Allow", "Action":["s3:PutObject","s3:GetObject","s3:GetObjectVersion", "s3:DeleteObject",\"s3:DeleteObjectVersion"], "Resource":"arn:aws:s3:::user.uploads/john/*" } ] }"
I have bucket user.uploads on S3 and the john folder
however, any download with session credentials in bucket user.uploads with the john / filename key fails with access denied "
source share