Google登录回调始终显示“immediate_failed”

时间:2014-04-15 11:42:52

标签: php api google-api facebook-social-plugins google-login

我正在尝试将Google登录信息集成到我的网站。 我关注谷歌开发者代码。 参考:https://developers.google.com/+/web/signin/add-button

但是我总是从signinCallback函数得到“immediate_failed”的响应结果。 有谁知道这方面的解决方案?

function signinCallback(authResult) {
 if (authResult['status']['signed_in']) {

// Update the app to reflect a signed in user
// Hide the sign-in button now that the user is authorized, for example:
document.getElementById('signinButton').setAttribute('style', 'display: none');

} else {

// Update the app to reflect a signed out user
// Possible error values:
//   "user_signed_out" - User is signed-out
//   "access_denied" - User denied access to your app
//   "immediate_failed" - Could not automatically log in the user
console.log('Sign-in state: ' + authResult['error']);

}
}

0 个答案:

没有答案