Created
March 6, 2018 05:00
-
-
Save trylovetom/acdeb8b090ec89fec2f1fe2fa0986095 to your computer and use it in GitHub Desktop.
Revisions
-
trylovetom created this gist
Mar 6, 2018 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ 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) })