How to use the CognitoIdentity function from aws-sdk

Find comprehensive JavaScript aws-sdk.CognitoIdentity code examples handpicked from public code repositorys.

36
37
38
39
40
41
42
43
44
45
  })
},
methods: {
  async getCreds () {
    console.log('getCreds called')
    const cognitoIdentity = new AWS.CognitoIdentity()

    return new Promise((resolve, reject) => {
      AWS.config.credentials.get(function (err) {
        if (!err) {
fork icon41
star icon0
watch icon0

318
319
320
321
322
323
324
325
326
327
328
        return awsConfig;
    }
}


async function getAdminCognitoCredentials(idToken, identityId, region) {
    const cognitoIdentity = new aws.CognitoIdentity({ region });
    const login = idToken.payload.iss.replace('https://', '');
    const { Credentials } = await cognitoIdentity
        .getCredentialsForIdentity({
            IdentityId: identityId,
fork icon2
star icon0
watch icon3

+ 8 other calls in file

5
6
7
8
9
10
11
12
13
14
15
16
17
AWS.config.update({region:'us-east-2'});


const util = require('../util');


const jwtDecode = require('jwt-decode');
const cognitoidentity = new AWS.CognitoIdentity();
const identityPoolId = process.env.COGNITO_IDENTITY_POOL_ID;


exports.handler = async event =>{
    try{
fork icon0
star icon0
watch icon0

4
5
6
7
8
9
10
11
12
13
14
15
var crypto = require('crypto');
var config = require('./config.json');


// Get reference to AWS clients
var dynamodb = new AWS.DynamoDB();
var cognitoidentity = new AWS.CognitoIdentity();


function computeHash(password, salt, fn) {
	// Bytesize
	var len = config.CRYPTO_BYTE_SIZE;
fork icon0
star icon0
watch icon0

23
24
25
26
27
28
29
30
31
32
    identityPoolId = null,
    clientAppId = null;

aws.config.region = region;
var cognitoProvider = new aws.CognitoIdentityServiceProvider(),
    cognitoIdentity = new aws.CognitoIdentity();


async.waterfall([
    createUserPool,
fork icon0
star icon0
watch icon0