我想在一个角度应用程序中集成谷歌身份工具包,但在流程之后不是,谷歌身份工具包小部件对谷歌 API 的调用返回错误。这是重定向后的路由,它是一个空页面http://localhost:8000/?mode=select/#/GoogleIdentity
发布/验证断言
{
"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: '/'' });