【发布时间】:2015-06-26 07:40:16
【问题描述】:
我想将谷歌身份工具包集成到一个角度应用程序中,但在流程之后不是,谷歌身份工具包小部件对谷歌 API 的调用返回错误。这是重定向后的路由,是一个空页面http://localhost:8000/?mode=select/#/GoogleIdentity
POST /verifyAssertion
{
"error": {
"errors": [
{
"domain": "global",
"reason": "invalid",
"message": "INVALID_RESPONSE"
}
],
code": 400,
"message": "INVALID_RESPONSE"
}
}
这是我的代码:
.controller('GoogleIdentityCtrl', ['$scope', '$rootScope', function ($scope, $rootScope, localStorageService) {
var config = {
apiKey: 'dkfjdslfjeoi-not-real-api-key',
signInSuccessUrl: '/',
idps: ['google'],
oobActionUrl: 'http://localhost:8000/#/GoogleIdentity',
siteName: 'this site',
};
window.google.identitytoolkit.start('#gitkitWidgetDiv', config, 'JAVASCRIPT_ESCAPED_POST_BODY');
}]);
window.google.identitytoolkit.signInButton('#navbar', { widgetUrl: 'http://localhost:8000/#/GoogleIdentity', signOutUrl: '/'' });
【问题讨论】:
-
你能解决这个问题吗?我有一个可以发布的解决方案。
标签: angularjs google-identity-toolkit google-identity