在AWS Cognito中请求用户列表时遇到UnknownError

时间:2018-07-31 12:13:31

标签: amazon-web-services amazon-cognito aws-cognito aws-sdk-js

我使用Node.js实施AWS Cognito。我的身份验证和用户注册工作正常。现在,我被困在从Cognito用户池中获取注册用户的列表中。我正在

  

“代码”:“ UnknownError”和“消息”:“未找到”

。我在下面添加示例代码-

var poolData = {
    UserPoolId: 'us-east-2_*****'
  };


  var aws = require('aws-sdk');
  aws.config.update({accessKeyId: '******', secretAccessKey: '******'});

  var CognitoIdentityServiceProvider = aws.CognitoIdentityServiceProvider;
  var client = new CognitoIdentityServiceProvider({ apiVersion: '2016-04-19', region: 'us-east-2' });

  client.listUsers(poolData,function(err, data) {
      if (!err) {
          console.log('successful' + JSON.stringify(data));
      } else {
          console.log('error ' + err);
      }
  });

0 个答案:

没有答案