Closed Private-SO closed 5 years ago
I got this using below snippet
AWS.config.credentials.get(function(err,data) {
if (!err) {
var id = AWS.config.credentials.identityId;
var key = AWS.config.credentials.accessKeyId;
var secretkey = AWS.config.credentials.secretAccessKey;
var sessionToken = AWS.config.credentials.sessionToken;
console.log('Cognito Identity ID '+ id);
console.log('Cognito Key '+ key);
console.log('Cognito Secret Key '+ secretkey);
console.log('Cognito SessionToken '+ sessionToken);
}
});
Usecase : I want to limit access to my API gateway paths using federated identites.
For that i need to get AWS temporary credentials by using my ID token. I got my Id token but i donot know how to get temporary credentials using Id token.
Here is am passing ID token to cognito credentials map
How to get temporary credentials ?
BTW the credentials (ie.access key,secret access key etc) showed in REINVENT is temporary credentials ? If it is then where you had defined them in this app ?
Thanks