AWSCognito 登录提供商错误
AWSCognito Login Provider Error
所以我有点慢,根据它说的文档
"Logins - A map of logins for this identity. As with GetId and
GetOpenIdToken, you can supply any supported public
provider token, but you can additionally supply a user
identifier keyed by the developer provider name that
you set when you created the identity pool.This should be
a unique identifier for this user in your system."
我在创建身份池时已经添加了我的登录提供商,但在访问 AWS Cognito 时出现此错误。
"InvalidParameterException: Please specify at least one login provider"
是我的登录提供商的问题吗?登录提供商密钥与我在创建 IdentityPool 时添加的密钥相匹配
var params = {
IdentityPoolId: 'us-east-1:2e90e469-c81a-4936-b78a-7071e79b3032', /* required */
Logins: { /* required */
"login.appName.myapp": 'userIdentifier',
/* anotherKey: ... */
},
IdentityId: null,
TokenDuration: 1
};
"login.appName.myapp" 的值是生成的唯一字符串,我认为应该没问题。
------------------------更新---------------- -------
var cognitoidentity = new AWS.CognitoIdentity();
var params = {
IdentityPoolId:'us-east-1:2e90e469-c81a-4936-b78a-7071e79b3032',
Logins: {
},
IdentityId: null,
TokenDuration: 1
};
cognitoidentity.getOpenIdTokenForDeveloperIdentity(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
我一直在使用这个 aws 文档作为参考:http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/CognitoIdentity.html#getOpenIdTokenForDeveloperIdentity-property
假设您使用 JavaScript SDK 进行此调用,请尝试使用代码 。
更新:
在上面更新的代码示例中传递给 getOpenIdTokenForDeveloperIdentity 的登录映射中,您需要添加一个键和一个值。密钥应该是您在控制台中为您的身份池添加的开发人员提供者的名称。该值应该是您用来唯一标识用户的标识符(您选择的任何唯一标识符,例如用户 ID 或电子邮件地址)。
所以我有点慢,根据它说的文档
"Logins - A map of logins for this identity. As with GetId and
GetOpenIdToken, you can supply any supported public
provider token, but you can additionally supply a user
identifier keyed by the developer provider name that
you set when you created the identity pool.This should be
a unique identifier for this user in your system."
我在创建身份池时已经添加了我的登录提供商,但在访问 AWS Cognito 时出现此错误。
"InvalidParameterException: Please specify at least one login provider"
是我的登录提供商的问题吗?登录提供商密钥与我在创建 IdentityPool 时添加的密钥相匹配
var params = {
IdentityPoolId: 'us-east-1:2e90e469-c81a-4936-b78a-7071e79b3032', /* required */
Logins: { /* required */
"login.appName.myapp": 'userIdentifier',
/* anotherKey: ... */
},
IdentityId: null,
TokenDuration: 1
};
"login.appName.myapp" 的值是生成的唯一字符串,我认为应该没问题。
------------------------更新---------------- -------
var cognitoidentity = new AWS.CognitoIdentity();
var params = {
IdentityPoolId:'us-east-1:2e90e469-c81a-4936-b78a-7071e79b3032',
Logins: {
},
IdentityId: null,
TokenDuration: 1
};
cognitoidentity.getOpenIdTokenForDeveloperIdentity(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
我一直在使用这个 aws 文档作为参考:http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/CognitoIdentity.html#getOpenIdTokenForDeveloperIdentity-property
假设您使用 JavaScript SDK 进行此调用,请尝试使用代码
更新: 在上面更新的代码示例中传递给 getOpenIdTokenForDeveloperIdentity 的登录映射中,您需要添加一个键和一个值。密钥应该是您在控制台中为您的身份池添加的开发人员提供者的名称。该值应该是您用来唯一标识用户的标识符(您选择的任何唯一标识符,例如用户 ID 或电子邮件地址)。