Oauth 2.0 用于Google Drive的OAuth2客户端应用程序登录
我正在尝试按照的说明使用google drive应用程序登录。我拥有的OAuth API信息是:Oauth 2.0 用于Google Drive的OAuth2客户端应用程序登录,oauth-2.0,google-drive-api,Oauth 2.0,Google Drive Api,我正在尝试按照的说明使用google drive应用程序登录。我拥有的OAuth API信息是: Client ID for web applications Client ID: 444837786259.apps.googleusercontent.com Email address: 444837786259@developer.gserviceaccount.com Client secret: [snip] Redirect URIs:
Client ID for web applications
Client ID: 444837786259.apps.googleusercontent.com
Email address: 444837786259@developer.gserviceaccount.com
Client secret: [snip]
Redirect URIs: http://meridiandigital.co.uk/drivecrypt/
http://apate.meridiandigital.net/drivecrypt/
JavaScript origins: http://meridiandigital.co.uk
http://apate.meridiandigital.net
Client ID for Drive SDK
Client ID: 444837786259-8vsffg8dnl2s8hvoeiu8v0laqaqc5p2p.apps.googleusercontent.com
Client secret: [snip]
在我的客户机中,我检测到没有有效令牌的情况,并将用户发送到以下URL
https://accounts.google.com/o/oauth2/auth?scope=https://www.googleapis.com/auth/drive.file+https://www.googleapis.com/auth/userinfo.email+https://www.googleapis.com/auth/userinfo.profile&response_type=token&redirect_uri=http://apate.meridiandigital.net/drivecrypt/&client_id=444837786259-8vsffg8dnl2s8hvoeiu8v0laqaqc5p2p.apps.googleusercontent.com
我从谷歌收到以下错误消息:
The redirect URI in the request: http://apate.meridiandigital.net/drivecrypt/ did not match a registered redirect URI
from_login=1
scope=https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/drive.file
response_type=token
access_type=online
redirect_uri=http://apate.meridiandigital.net/drivecrypt/
approval_prompt=auto
as=488fe0f410123e7c
pli=1
client_id=444837786259-8vsffg8dnl2s8hvoeiu8v0laqaqc5p2p.apps.googleusercontent.com
authuser=0
hl=en-GB
你知道我做错了什么吗?你需要使用API控制台生成的webapplication客户端ID(你的Drive SDK应用程序也需要使用该ID)
出现此错误是因为没有为客户端ID注册重定向URI
444837786259-8VSFFG8DNL2S8HVOEIU8V0LAQAQ5P2P.apps.googleusercontent.com
。如果您尝试使用444837786259.apps.googleusercontent.com
,它应该会起作用。您需要使用API控制台生成的Web应用程序的客户端ID(也可以对驱动器SDK应用程序使用相同的ID)
出现此错误是因为没有为客户端ID注册重定向URI444837786259-8VSFFG8DNL2S8HVOEIU8V0LAQAQ5P2P.apps.googleusercontent.com
。如果您尝试使用444837786259.apps.googleusercontent.com
,它应该可以工作