Skip to content

Instantly share code, notes, and snippets.

@trylovetom
Created March 6, 2018 05:00
Show Gist options
  • Save trylovetom/acdeb8b090ec89fec2f1fe2fa0986095 to your computer and use it in GitHub Desktop.
Save trylovetom/acdeb8b090ec89fec2f1fe2fa0986095 to your computer and use it in GitHub Desktop.
LocalTest
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