Created
March 6, 2018 05:00
-
-
Save trylovetom/acdeb8b090ec89fec2f1fe2fa0986095 to your computer and use it in GitHub Desktop.
LocalTest
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const AWS = require('aws-sdk') | |
AWS.config.region = 'us-east-1' | |
// Functions | |
const getCredentials = IdentityId => { | |
const cognito = new AWS.CognitoIdentity({ apiVersion: '2014-06-30' }) | |
const params = { | |
IdentityId | |
} | |
return cognito.getCredentialsForIdentity(params).promise() | |
} | |
getCredentials('...') | |
.then(data => { | |
console.log(JSON.stringify(data, null, 2)) | |
}) | |
.catch(err => { | |
console.log(err) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment