How to create allowed s3 url for query string?

Apparently s3 supports URLs of the form:

http://s3.amazonaws.com/bucket/file.txt?some_kind_of_auth_token

How to create a "secure" url like this?

+4
source share
1 answer

This is official help that describes how to do this.

Locate the section titled "Request for query string request authentication"

GET /photos/puppy.jpg?AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE& Signature=rucSbH0yNEcP9oM2XNlouVI3BH4%3D& Expires=1175139620 HTTP/1.1 

Here, edit the help page.

You can authenticate certain types of requests by passing the required information as query string parameters instead of using the authorization HTTP header. This is useful for allowing third-party browsers to directly access your Amazon S3 data without proxying the request. The idea is to create a โ€œpre-signedโ€ request and encode it as the URL that the end user's browser can receive. In addition, you can limit the pre-signed request by specifying the expiration time.

+6
source

Source: https://habr.com/ru/post/1398671/


All Articles