title: UnrecognizedClientException: The security token included in the request is invalid
body: <p>I am currently trying my hands on Amazon cognito. I am trying to access a record in dataset held by the identity_id of the pool I created. Below is the code on how I initialize amazon cognito:</p>
  
  <pre><code>AWS.config.region = 'us-east-1';
  var cognitoConfig = {
      "accessKeyId": "gibberish"//AWS_ACCESS_KEY,
      "secretAccessKey": "secret_gibberish" //AWS_SECRET_ACCESS_KEY,
      "sessionToken": null,
      "region": "us-east-1",
      credentials: new AWS.CognitoIdentityCredentials({        
          IdentityPoolId: 'us-east-1:cb879fe2-b638-44dd-826d-fabc10ac639f'
      }), 
  };
  AWS.config.update(cognitoConfig);
  </code></pre>
  
  <p>I am using cognito sync for accessing the record in dataset under the specified identitiy_id.</p>
  
  <pre><code>var cognitosync = new AWS.CognitoSync();
  cognitosync.listRecords({
              DatasetName: config.COGNITO_USERS_DATASET,
              IdentityId: identity_id,
              IdentityPoolId: config.COGNITO_IDENTITY_POOL_ID
          }, function (err, data) {
  
              if (err) {
                 console.log("Cognito Error: ", err);
              }
  
              var identity_records = {};
  
              data.Records.forEach(function (item) {
                  if (item) {
                      identity_records[item.Key] = item.Value;
                  }
              });              
  
          });
  </code></pre>
  
  <p>When I execute these lines of code, I get the following </p>
  
  <pre><code>error: { [UnrecognizedClientException: The security token included in the request is invalid.]
    message: 'The security token included in the request is invalid.',
    code: 'UnrecognizedClientException',
    time: Wed Nov 09 2016 17:07:10 GMT+0000 (UTC),
    requestId: '1b2550a8-a69f-11e6-8c97-37b2029bd20b',
    statusCode: 403,
    retryable: false,
    retryDelay: 93.38622682262212 }
  </code></pre>
  
  <p>What is wrong I am doing? Please enlighten me on what I am missing. </p>