Javascript NotAuthorizedException:当使用Google作为身份提供程序时,令牌不是来自此身份池的受支持提供程序
在使用Google调用federatedSignIn时,它返回一个 “NotAuthorizedException:使用Google作为身份提供程序时,令牌不是来自此身份池的受支持提供程序” 我正在使用一个第三方库,即angular5社交登录来登录谷歌等社交提供商。我相信我已经在cognito和联邦实体中按照预期配置了它 这是我的示例代码Javascript NotAuthorizedException:当使用Google作为身份提供程序时,令牌不是来自此身份池的受支持提供程序,javascript,amazon-web-services,single-sign-on,cognito,Javascript,Amazon Web Services,Single Sign On,Cognito,在使用Google调用federatedSignIn时,它返回一个 “NotAuthorizedException:使用Google作为身份提供程序时,令牌不是来自此身份池的受支持提供程序” 我正在使用一个第三方库,即angular5社交登录来登录谷歌等社交提供商。我相信我已经在cognito和联邦实体中按照预期配置了它 这是我的示例代码 this.socialAuthService.signIn(socialPlatformProvider).then( (userData) =&
this.socialAuthService.signIn(socialPlatformProvider).then(
(userData) => {
console.log(socialPlatform+" sign in data : " , userData);
// Now sign-in with userData
let user = {
email:userData.email,
name: userData.name
}
Auth.federatedSignIn(
// Initiate federated sign-in with Google identity provider
'google',
{
// the JWT token
token: userData.idToken,
expires_at: null
},
// a user object
user
).then(a => {
// ...
console.log(a)
});
这是
这是我做的配置
关于联邦实体
两者都有相同的google客户端id
我相信我已经在用户池和联邦实体中进行了必要的配置。但是,我仍然遇到同样的问题我不熟悉您使用的特定库,但我相信问题很可能是由于您使用的“google”字符串造成的。你应该通过“accounts.google.com”来代替
我想到的另一个问题是:你确定你需要一个用户池吗?也许您只需要一个标识池(联邦标识)?如果您只想允许您的用户登录Google,您不需要用户池。当我使用
cognito
进行身份验证时,这个问题发生在我身上
我建议您检查您的凭据,并确保您的cognito应用程序客户端ID是正确的
您可以从用户池中检查该值
App integration => App client settings