我能够通过Google+ Api
我遇到问题的一件事是:
问题:有没有办法在代码中添加或确定用户是否未在Google +中创建帐户?
另一个问题是当该帐户是链接时,它会在浏览器中记录但显示错误"Failed to upgrade the authorization code"
当我调试我的代码时,它在流认证中出错:
try:
# Upgrade the authorization code into a credentials object
oauth_flow = flow_from_clientsecrets(os.getcwd()+path+'client_secrets.json', scope='')
oauth_flow.redirect_uri = 'postmessage'
credentials = oauth_flow.step2_exchange(code)
except FlowExchangeError:
return 'Failed to upgrade the authorization code.'
以下是我视图中传递的参数:
<meta name="google-signin-scope" content="https://www.googleapis.com/auth/plus.login" />
<meta name="google-signin-requestvisibleactions" content="http://schemas.google.com/AddActivity" />
<meta name="google-signin-cookiepolicy" content="single_host_origin" />
问题与参数有关吗?可能是什么问题?
问题与这个问题有关。 Issue with Google+ upgrade via OAuth2 and multiple sign-in
client_secrets.json
:
{ "web":
{ "client_id": "1314.....googleusercontent.com",
"client_secret": "Se8....",
"client_email": "1314...@developer.gserviceaccount.com",
"redirect_uris": [ "postmessage"],
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://accounts.google.com/o/oauth2/token"
}
}
希望得到你的帮助。谢谢。