mercredi 4 février 2015

AWS API signed POST request with Javascript

What I'm trying to do: Ultimately: I want to populate an AWS Kinesis stream from a browser extension (Safari, Chrome). I need to send the request to AWS using a signing process (v4); this involves setting headers and encrypting them (on a distant server with the aws secret key) to finally join those to the request.


Amazon requests the header "Host" to be explicitly defined… However Javascript strictly disallow setting it (and a bunch of others, for good reasons)


I must be missing something—how can I do this?


sources: http://ift.tt/1r81TsY - the example is in Python but it shows how server-side they intend to use the Host header notes: the example's comments describing the GET and query string mention the "Host": it must exist as a header in the request


also: Using a similar setup, I managed to have a file uploaded from the client directly to an S3 bucket–the autorisation process is slightly different (no requirement for 'Host').


Aucun commentaire:

Enregistrer un commentaire