title: AWS Cognito Developer Authenticated Identities using JavaScript SDK
body: <p>I need to implement Developer Authenticated Identities using JavaScript SDK, but am facing issues with it. I've configured an identity pool with a Custom Authentication Provider</p>
  
  <p><strong>On Server:</strong></p>
  
  <pre><code>AWS.config = new AWS.Config({
      region: 'ap-northeast-2',   
      credentials: new AWS.Credentials('XXXXXS7FJBAOO5IXXXXX', 'XXXXXYBo4jmfsu7K0qJSFvu3nlVvYOcVz4GXXXXX')
  });
  
  var params = {
      IdentityPoolId: 'ap-northeast-2:a383cb2e-e302-4ff6-8d8f-70e3185XXXXX',
      Logins: {
          'com.abc.xyz': '9876543210' // different value for each user
      }
  };
  
  var cognitoidentity = new AWS.CognitoIdentity();
  cognitoidentity.getOpenIdTokenForDeveloperIdentity(params, function(err, data) {
      if (err) {
          console.log(err, err.stack); // an error occurred
      }
      else {
          console.log(data);           // successful response
      }
  });
  </code></pre>
  
  <p><strong>Server Result:</strong></p>
  
  <pre><code>IdentityId: "ap-northeast-2:5cf7f3cd-b370-416b-bed8-f7f8c7aXXXXX"
  Token: "eyJra.....sL8bg"
  </code></pre>
  
  <p><strong>On Browser:</strong></p>
  
  <pre><code>AWS.config = new AWS.Config({
      region: 'ap-northeast-2'
  });
  
  var params = {
      IdentityId: 'ap-northeast-2:5cf7f3cd-b370-416b-bed8-f7f8c7aXXXXX',      //Received from server
      CustomRoleArn: 'arn:aws:iam::356127965XXX:role/XXXXX_Customer',
      Logins: {
          'com.abc.xyz': '9876543210'
      }
  };
  
  var cognitoidentity = new AWS.CognitoIdentity();
  cognitoidentity.getCredentialsForIdentity(params, function(err, data) {
      if (err) {
          console.log(err, err.stack); // an error occurred
      }
      else {
          console.log(data);           // successful response
      }
  });
  </code></pre>
  
  <p><strong>Browser Result:</strong></p>
  
  <pre><code>Please provide a valid public provider
  </code></pre>
  
  <p><strong>Identity Pool Configuration</strong>
  <a href="https://i.stack.imgur.com/KxoHf.png" rel="noreferrer"><img src="https://i.stack.imgur.com/KxoHf.png" alt="Identity Pool Configuration"></a></p>