title: Missing credentials in config : Cognito (for the unauthenticated) and S3
body: <p>While following simple, and official tutorial <a href="https://github.com/awsdocs/aws-javascript-developer-guide-v2/blob/master/s3-example-photo-album.md" rel="noreferrer">here(Uploading Photos to Amazon S3 from a Browser(using Cognito for unauthenticated users))</a>, I got error <strong>"Missing credentials in config"</strong>.  As like below, the code is quite simple, but don't know why the error occurs even though I think I fully followed the prerequirements for the tutorial. I am curious to when the error message <strong>"Missing credentials in config"</strong> appears, so that I might guess the reason. Is this because AWS has changed or am I making something wrong? 
  It would be truly thankful if you let me know the right answer or any hints.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  
  &lt;head&gt;
      &lt;meta charset="UTF-8"&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
      &lt;meta http-equiv="X-UA-Compatible" content="ie=edge"&gt;
      &lt;title&gt;Document&lt;/title&gt;
      &lt;script src="https://sdk.amazonaws.com/js/aws-sdk-2.255.1.min.js"&gt;&lt;/script&gt;
      &lt;script&gt;
          var bucketName = 'mama-swedenhouse-resources';
          var bucketRegion = 'ap-northeast-2';
          var identityPoolId = 'ap-northeast-2:f4250b2e-5d77-4413-bc3a-34c4xxxxxxxx'; //just hiding last 8 letters on this github issue 
  
          AWS.config.update({
              region: bucketRegion,
              credentials: new AWS.CognitoIdentityCredentials({
                  identityPoolId: identityPoolId
              })
          });
  
          var s3 = new AWS.S3({
              apiVersion: '2006-03-01',
              params: {
                  Bucket: bucketName
              }
          });
  
          function uploadPhoto() {
  
              var files = document.getElementById('test-file-input').files;
              if (!files.length) {
                  return alert('Please choose a file to upload first.');
              }
              var file = files[0];
              var fileName = file.name;
  
              s3.upload({
                  Key: fileName + ' ' + Math.floor(Date.now()),
                  Body: file,
                  ACL: 'public-read'
              }, function (err, data) {
                  if (err) {
                      console.log(err);
                      return console.log('There was an error uploading your photo: ', err.message);
                  }
                  console.log('Successfully uploaded photo.');
              });
          };
      &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;section&gt;
      &lt;input type="file" name="test-file-input" id="test-file-input" accept="image/*"&gt;
      &lt;button id="uplaod-btn" onclick="uploadPhoto();"&gt;업로드&lt;/button&gt;
  &lt;/section&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <h3>Error message (on Chrome's console)</h3>
  
  <pre><code>Error: Missing credentials in config
      at constructor.fail (aws-sdk-2.255.1.min.js:50)
      at constructor.validateStructure (aws-sdk-2.255.1.min.js:50)
      at constructor.validateMember (aws-sdk-2.255.1.min.js:50)
      at constructor.validate (aws-sdk-2.255.1.min.js:50)
      at constructor.&lt;anonymous&gt; (aws-sdk-2.255.1.min.js:49)
      at constructor.callListeners (aws-sdk-2.255.1.min.js:51)
      at constructor.emit (aws-sdk-2.255.1.min.js:51)
      at constructor.emitEvent (aws-sdk-2.255.1.min.js:50)
      at constructor.e (aws-sdk-2.255.1.min.js:50)
      at a.runTo (aws-sdk-2.255.1.min.js:52)
  aws-s3-upload.html:48 There was an error uploading your photo:  Missing credentials in config
  </code></pre>