title: Amazon S3: 403 forbidden "Invalid according to policy: policy expired" (Ruby)
body: <p>I am using the Froala HTML editor to upload images directly to an Amazon S3 bucket.  It has been working perfectly fine for the last several months.  I have not changed anything on the development side.</p>
  
  <p>About a day ago, all my image uploads to Amazon S3 started failing and getting a <code>403 "Invalid according to policy: policy expired"</code> response.</p>
  
  <p>I realized my bucket didn't have a policy, and was using the old ACL for permissions (my understanding is that policies are replacing ACL?).</p>
  
  <p>I updated my policy using the Amazon policy generator, and I'm still getting the 403.</p>
  
  <p>I tried setting the policy to public just trying to get it to work (note that I've removed anything I thought was sensitive):</p>
  
  <pre><code>{
      "Version": "2012-10-17",
      "Id": "Policy123...",
      "Statement": [
          {
              "Sid": "Stmt123...",
              "Effect": "Allow",
              "Principal": "*",
              "Action": "*",
              "Resource": "arn:aws:s3:::&lt;BUCKET_NAME&gt;/*"
          }
      ]
  }
  </code></pre>
  
  <p>From my understanding, this policy should allow full public access to the bucket for any action.  Obviously I don't want this for production, but I'm just trying to get it to work again.</p>
  
  <p>However, I still get a 403 "policy expired".</p>
  
  <p>I've seen some other posts about updating computer clocks, but I haven't changed anything on my computer or the servers and I don't have an expiration set in my policy, so I'm not sure why that would matter.</p>
  
  <p>The Amazon S3 console even warns me that I have set public access on the bucket, so I know that the policy is at least "somewhat" working.</p>
  
  <p><strong>Questions</strong></p>
  
  <ol>
  <li>If I update the Amazon S3 policy, do I need to update my application <code>accessKey</code> or <code>secretKey</code> that I use to sign uploads?</li>
  <li>Is there anything I can try to explicitly remove a policy expiration?  My users will be uploading images, and I don't want the application "user" to expire, it should always be valid?</li>
  </ol>