简体   繁体   中英

aws s3 allow access to bucket prefix for cognito user

I have the following setup:

user logs in with cognito. He should now be able to use an s3 item url as the src of an html5 video.

<video src='http://aws.s3.somebucket/userId/videoId.mp4' />

I have managed to use the sdk for the login and now have the authorization token on the client. How do I setup the bucket to allow access to the directory matching the userId, and how can I trigger/pass the authorization token?

You should integrate your user pool with Federated identities following this .

Setup the identity pool for S3 access following this .

After this you will get AWS credentials which would allow the user to only access based on the identityId.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM