我得到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。