【发布时间】:2021-05-23 14:21:39
【问题描述】:
我可以为 Cognito 身份池成功运行 describeIdentityPool 命令,并启用“启用对未经身份验证的身份的访问”:
var AWS = require("aws-sdk");
let cognitoidentity = new AWS.CognitoIdentity();
var params = {IdentityPoolId: "myIdentityPoolID"};
cognitoidentity.describeIdentityPool(params, function(err, data) {
if (err) {
console.log(err, err.stack);
}
else {
console.log( "...getCredentials.describeIdentityPool.data:", data);
}
});
但如果我禁用“启用对未经身份验证的身份的访问”复选框,我会收到错误消息:
NotAuthorizedException: Unauthenticated access is not supported for this identity pool.
有没有办法授权我向 Cognito 身份池发出的请求以避免此错误?
【问题讨论】:
标签: javascript amazon-web-services amazon-cognito