title: Amazon AWS Request Token From Secure Token Service
body: <p>I'm trying to sign an amazon sts token request to get temporary access to my S3 account. I've been following the instructions for Signature Version 4 with no luck.</p>
  
  <p>I am constantly getting this message back from amazon sts.</p>
  
  <p><code>&lt;Code&gt;IncompleteSignature&lt;/Code&gt;</code></p>
  
  <p><code>&lt;Message&gt;Request must contain a signature that conforms to AWS standards&lt;/Message&gt;</code></p>
  
  <p>Here is the url request that I am sending.</p>
  
  <pre><code>https://sts.amazonaws.com/?AWSAccessKeyId=**********&amp;Action=GetFederationToken&amp;DurationSeconds=3600&amp;SignatureMethod=HmacSHA256&amp;SignatureVersion=4&amp;Timestamp=2013-04-23T19:01:00Z&amp;Version=2011-06-15&amp;Signature=2fc3dc902a20a5aa25c3191f2aa6513088e11596082b6a563b00dc5ea4b8bfa0
  </code></pre>
  
  <p>Following the steps for Signature Version 4 this is how I calculated the signature.</p>
  
  <p><a href="http://docs.aws.amazon.com/general/latest/gr/sigv4_signing.html" rel="nofollow">http://docs.aws.amazon.com/general/latest/gr/sigv4_signing.html</a></p>
  
  <p>Task 1:</p>
  
  <pre><code>GET\n
  /\n
  AWSAccessKeyId=&lt;Access Key Removed&gt;&amp;
  Action=GetFederationToken&amp;
  DurationSeconds=3600&amp;
  SignatureMethod=HmacSHA256&amp;
  SignatureVersion=4&amp;
  Timestamp=2013-04-23T19:01:00Z&amp;
  Version=2011-06-15\n
  host:sts.amazonaws.com\n
  host\n
  e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
  </code></pre>
  
  <p>Task 2:</p>
  
  <pre><code>AWS4-HMAC-SHA256\n
  20130423T190100Z\n
  20130423/us-gov-west-1/sts/aws4_request\n
  5e769aeb49a050fd7cd1035122712098fd83220ea42a0d9871f0ff2fa622b1c6
  </code></pre>
  
  <p>Task 3:</p>
  
  <pre><code>Signature: 2fc3dc902a20a5aa25c3191f2aa6513088e11596082b6a563b00dc5ea4b8bfa0
  </code></pre>
  
  <p>Any help would be greatly appreciated I've been working on this with no luck so far. Thanks in advance :) </p>