0

我得到400“请提供有效的公共提供商”当我尝试设置谷歌的访问令牌是这样的:AWS Cognito:收到“请提供有效的公共提供商”与谷歌

AWS.config.update(
{ 
    region: window.region, 
    credentials: new AWS.CognitoIdentityCredentials(
    { 
     IdentityPoolId: window.identityPoolId, 
     Logins: 
     { 
      'accounts.google.com': gapi.auth2.getAuthInstance().currentUser.get().getAuthResponse().id_token 
     } 
    }) 
}); 

Cognito被inited这样的:

window.region = Pointer_stringify(region); 
window.identityPoolId = 'us-east-1:xxxxxxxx-xxxx-xxxx-xxxx-xxxx'; 
var po = document.createElement('script'); 
po.type = 'text/javascript'; 
po.async = true; 
po.src = '/aws-sdk.min.js'; 
po.onload = function() 
{ 
    var po2 = document.createElement('script'); 
    po2.type = 'text/javascript'; 
    po2.async = true; 
    po2.src = '/amazon-cognito.min.js'; 
    po2.onload = function() 
    { 
     AWS.config.region = window.region; // Region 
     AWS.config.credentials = new AWS.CognitoIdentityCredentials(
     { 
      IdentityPoolId: window.identityPoolId, 
     }); 
    } 
    var s2 = document.getElementsByTagName('script')[0]; 
    s2.parentNode.insertBefore(po2, s2); 
} 
var s = document.getElementsByTagName('script')[0]; 
s.parentNode.insertBefore(po, s); 

我有谷歌的客户端ID添加到Authention提供商的Google+标签和accounts.google.com加入OpenID的标签。 这只发生在谷歌,它适用于Facebook。

回答

0

问题是我的身份池指向已删除的用户池。

0

您可能会看到此错误的原因之一是,如果您已为供应商名称为“accounts.google.com”的开发者认证流配置了您的池。您能否在Cognito Console中为您的游泳池中的自定义身份验证提供程序登录并确保它未设置为“accounts.google.com”?