Answers for "cognito listUser using amazon-cognito-identity-js"

0

cognito listUser using amazon-cognito-identity-js

var AWS = require('aws-sdk');

exports.getUsers= () => {
	var params = {
	  UserPoolId: USER_POOL_ID
	  AttributesToGet: [
	    'ATTRIBUTE_NAME',
	  ],
	};
	
	return new Promise((resolve, reject) => {
		AWS.config.update({ region: USER_POOL_REGION, 'accessKeyId': AWS_ACCESS_KEY_ID, 'secretAccessKey': AWS_SECRET_KEY });
		var cognitoidentityserviceprovider = new AWS.CognitoIdentityServiceProvider();
		cognitoidentityserviceprovider.listUsers(params, (err, data) => {
			if (err) {
				console.log(err);
				reject(err)
			}
			else {
				console.log("data", data);
				resolve(data)
			}
		})
	});
}
Posted by: Guest on July-06-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language