I'm using the aws-sdk javascript
in my back-end and I can use AWS
fine but when I try to use the getOpenIdTokenForDeveloperIdentity
method I get a "Missing region in config error"
as a response.
var config = new AWS.Config({
accessKeyId: "MYACCESSKEY", secretAccessKey: "MYSECRETYKEY", region: 'us-east-1'
});
var params = {
IdentityPoolId: 'MYIDENTITYPOOLID', /* required */
Logins: { /* required */
"login.my.myapp": 'string',
/* anotherKey: ... */
},
IdentityId: null,
TokenDuration: 0
};
cognitoidentity.getOpenIdTokenForDeveloperIdentity(params,function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
In the docs it said that:
By default, credentials and region settings are left unconfigured. This should be configured by the application before using any AWS service APIs.
So I set my region but why am I still getting an error?