简体   繁体   English

AWS Cognito-ConfigError:JavaScript SDK的配置中缺少区域

[英]AWS Cognito - ConfigError: Missing region in config for JavaScript SDK

I am trying to call createIdentityPool from JavaScript SDK. 我正在尝试从JavaScript SDK调用createIdentityPool。 Please find the below code from sample html screen - 请从示例html屏幕中找到以下代码-

var cognitoidentity = new AWS.CognitoIdentity({apiVersion: '2014-06-30'});    
AWS.config.apiVersions = {
  cognitoidentity: '2014-06-30',
  // other service API versions
};    
var cognitoidentity = new AWS.CognitoIdentity();    
AWS.config.region = 'us-east-1'; // Region    
AWS.config.apiVersions = {
  cognitoidentity: '2014-06-30',
  // other service API versions
};        
var params = {    
AllowUnauthenticatedIdentities: true, // required     
  IdentityPoolName: 'String', // required    
  DeveloperProviderName: 'String',    
  OpenIdConnectProviderARNs: [    
    "my Pool Identity", // Identity Pool ID    
 ],
};    
cognitoidentity.createIdentityPool(params, function (err, data) {    
  if (err) alert(err, err.stack); // an error occurred    
  else     alert(data);           // successful response    
});

Output alert is - 输出警报为 -

CredentialsError: Missing credentials in config CredentialsError:配置中缺少凭据

Can any one help me in this issue. 谁能在这个问题上帮助我。

Thanks, Rakesh. 谢谢,拉克什。

CreateIdentityPool must be called with your developer credentials. 必须使用您的开发人员凭据调用CreateIdentityPool。

You need to ensure that you have correctly initialized your SDK with AWS Credentials. 您需要确保已使用AWS Credentials正确初始化了SDK。 Credentials can be set globally on the AWS.config object or per service by passing the credential information to the service object directly. 通过将凭证信息直接传递到服务对象,可以在AWS.config对象或每个服务上全局设置凭证。

For more information on different ways to set credentials in your SDK, refer to: http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/node-configuring.html 有关在SDK中设置凭据的不同方法的更多信息,请参阅: http : //docs.aws.amazon.com/AWSJavaScriptSDK/guide/node-configuring.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 带有 Angular 4 的 AWS Cognito:错误:配置中缺少区域 - AWS Cognito with Angular 4: Error: Missing region in config AWS QLDB [错误] [Node.js QLDB 示例代码] 无法创建分类帐:ConfigError: Missing region in config - AWS QLDB [ERROR] [Node.js QLDB Sample Code] Unable to create the ledger: ConfigError: Missing region in config ConfigError:当我将 amazon ses 与 Node.js 一起使用时,配置中缺少区域 - ConfigError: Missing region in config when i am using amazon ses with Node.js aws-sdk-js DynamoDB引发错误:Request.VALIDATE_REGION的配置中缺少凭据 - aws-sdk-js DynamoDB throwing Error: Missing credentials in config at Request.VALIDATE_REGION 配置错误:配置中缺少区域 (AWS) - Configuration Error: Missing Region in Config (AWS) 在没有 AWS-SDK 的情况下使用 Cognito JavaScript SDK - Using Cognito JavaScript SDK without AWS-SDK AWS Cognito缺少功能 - AWS Cognito missing functions AWS cognito userpools JavaScript SDK获取用户的策略文档 - AWS cognito userpools JavaScript SDK get user's policy documents 使用JavaScript SDK的AWS Cognito Developer身份验证身份 - AWS Cognito Developer Authenticated Identities using JavaScript SDK AWS Dynamodb 配置中缺少凭证,如果使用 AWS_CONFIG_FILE,则设置 AWS_SDK_LOAD_CONFIG=1 - AWS Dynamodb Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM