AWS Cognito:通过 google 获取“请提供有效的公共提供商”
AWS Cognito: getting "Please provide a valid public provider" with google
当我尝试像这样设置 google 访问令牌时,我得到 400"请提供有效的公共提供者":
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 是这样启动的:
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);
我已将Google客户端ID添加到身份验证提供商的Google+选项卡中,accounts.google.com 添加到OpenID选项卡中。这只发生在谷歌身上,它适用于Facebook。
问题是我的身份池指向已删除的用户池。
您可能会看到此错误的原因之一是,如果已将池配置为经过开发人员身份验证的流,并且提供程序名称为"accounts.google.com"。您能否在 Cognito 控制台中检查池中的自定义身份验证提供程序,并确保它未设置为"accounts.google.com"?
相关文章:
- AWS Cognito:通过 google 获取“请提供有效的公共提供商”
- 角度模态服务未知提供商
- 选择下拉列表需要在选中时显示提供商的详细信息-无法通过我的脚本显示url
- 从服务提供商 IP 地址获取设备 IP 地址
- JsFiddle:未知提供商:$intervalProvider <- $interval
- 工厂和控制器,未知提供商
- 未知提供商:$resourceProvider - AngularJS
- 未知提供商:捆绑后$resourceProvider
- ES2015 单例或服务提供商或模块,用于敲除.js组件
- $http提供商向 Github API 发出外部请求,但不向 Google 地图 API 发出请求
- Angular Js:工厂、服务和提供商.何时使用哪个
- AngularJS + RequireJS.未知提供商:$routeProvider
- 为什么我必须添加尾部'提供商'到服务名称,当我使用es6时
- Chrome中阻止的视频-运行视频提供商的不安全内容
- 如何在AngularJs中设置来自其提供商的服务的依赖关系
- 单个<提供商>用于许多组件
- 从PhoneGap JavaScript访问Android上的内容提供商
- 未知提供商AngularJs在添加“时”;.运行”;
- AngularJS提供商和模型
- Angular未知提供商错误