title: How can I use AWS Signature Version 4 with AWS Javascript SDK to upload to S3 from the browser?
body: <p>I need to be able to upload large (1+ gb) files to S3 from the user's browser. Sending them through the application server (PHP) is simply not an option because of size and load constraints.</p>
  
  <p>I would like to use the AWS Javascript SDK to do this, as shown here: <a href="http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/browser-examples.html#Uploading_a_local_file_using_the_File_API" rel="nofollow">http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/browser-examples.html#Uploading_a_local_file_using_the_File_API</a></p>
  
  <p>The problem is, the Javascript SDK only (officially) lists a few authentication methods, and it isn't clear how you can make the SDK use "AWS Signature V4" authentication, as shown here: <a href="http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-post-example.html" rel="nofollow">http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-post-example.html</a></p>
  
  <p>The question is:
  Can you use "Signature V4" with the "AWS JS SDK"?</p>
  
  <p>Edit: It sounds like maybe I need to use the "Security Token Service" : <a href="http://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html" rel="nofollow">http://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html</a> Can anyone confirm if this is the right way to go?</p>
  
  <p>More specifics that may be relevant:
  My use case is in the admin area of an online store, where the admin user is already authenticated by logging into the admin section, but still shouldn't be able to see the master AWS secret key.
  The AWS JS SDK lets you authenticate with Facebook or other ID providers, but this would be a weird user-experience since the admin has already logged in.</p>
  
  <p>Because this functionality must be packaged into a single module for installation in an ecommerce platform (Magento,) it isn't feasible to ask the installer to also go and create a new IAM role with separate credentials just for the uploader feature.</p>