如何检索亚马逊s3临时凭证?

时间:2022-11-19 09:36:35

I've got a Django Rest API and a React Native app. I'd like to upload some files to my s3 bucket from my app.

我有一个Django Rest API和一个React Native应用程序。我想从我的应用程序上传一些文件到我的s3存储桶。

I could do this :

我能做到这一点:

  1. User would like to upload an image --> GET my_api/s3/credentials/
  2. 用户想上传图片 - >获取my_api / s3 / credentials /
  3. App --> POST image directly to s3 using credentials (access/private keys)
  4. 应用程序 - >使用凭据(访问/私钥)将映像直接POST到s3

The problem is that once the user has the accessKey and privateKey, he can use it indefinitely.

问题是,一旦用户拥有accessKey和privateKey,他就可以无限期地使用它。

Is there a way to retrieve temporary credentials I could give to the user after a call on my_api/s3/credentials/ ?

有没有办法检索我在my_api / s3 / credentials /上调用后可以给用户的临时凭证?

1 个解决方案

#1


1  

I've found an answer. It is possible to generate from server side a temporary URL to POST your content.

我找到了答案。可以从服务器端生成临时URL以POST内容。

details here

详情请点击

#1


1  

I've found an answer. It is possible to generate from server side a temporary URL to POST your content.

我找到了答案。可以从服务器端生成临时URL以POST内容。

details here

详情请点击