简体   繁体   English

仅限 Cognito 身份验证用户的 S3 访问

[英]S3 Access for only Cognito Authenticated User

For a small project i am developing using angular framework, i have autenticated users with access, id and refresh tokens from cognito which is used to log into the site.对于我正在使用 angular 框架开发的一个小项目,我拥有来自用于登录网站的 cognito 的访问、id 和刷新令牌的认证用户。 Now is there any way to use these tokes to grant access to uploading and downloading files from and to my s3 bucket?现在有什么方法可以使用这些令牌来授予从我的 s3 存储桶上传和下载文件的权限?

Create a pre-signed URL for the get or put operation, and pass that back to the frontend which will do the actual upload or download using that url.为 get 或 put 操作创建一个预签名的 URL,并将其传递回前端,前端将使用该 url 进行实际上传或下载。

Here's an example from the golang docs:这是来自 golang 文档的示例:

https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/s3-example-presigned-urls.html https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/s3-example-presigned-urls.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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