lib/credentials/cognito_identity_credentials.js
function CognitoIdentityCredentials(params) {
    AWS.Credentials.call(this);
    this.expired = true;
    this.webIdentityCredentials = new AWS.WebIdentityCredentials(params);
    this.cognito = new AWS.CognitoIdentity({params: params});
    this.sts = new AWS.STS();
    this.params = params;
    this.data = null;
    this.identityId = null;
    this.loadCachedId();
  }
function CognitoIdentityCredentials(params) {
    AWS.Credentials.call(this);
    this.expired = true;
    this.webIdentityCredentials = new AWS.WebIdentityCredentials(params);
    this.cognito = new AWS.CognitoIdentity({params: params});
    this.sts = new AWS.STS();
    this.params = params;
    this.data = null;
    this.identityId = null;
    this.loadCachedId();
  }
Creates a new credentials object.
@param (see AWS.STS.assumeRoleWithWebIdentity)
@param (see AWS.CognitoIdentity.getOpenIdToken)
@example Creating a new credentials object
AWS.config.credentials = new AWS.CognitoIdentityCredentials({
AccountId: '1234567890',
IdentityPoolId: 'us-east-1:1699ebc0-7900-4099-b910-2df94f52a030',
RoleArn: 'arn:aws:iam::1234567890:role/MYAPP-CognitoIdentity',
Logins: { // optional tokens, used for authenticated login
'graph.facebook.com': 'FBTOKEN',
'www.amazon.com': 'AMAZONTOKEN',
'accounts.google.com': 'GOOGLETOKEN'
},
RoleSessionName: 'web' // optional name, defaults to web-identity
});
@see AWS.STS.assumeRoleWithWebIdentity