English 中文(简体)
OAuth2 Google 驱动器客户端应用程序登录
原标题:OAuth2 client-side application login for Google Drive

我在上努力遵循这些指示,以便用google驱动程序登录。

Client ID for web applications
Client ID:          444837786259.apps.googleusercontent.com
Email address:      [email protected]
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

知道我做错了什么吗?

最佳回答

您需要使用由 APIs 控制台生成的网络应用程序的客户端 ID( 并对您的驱动器 SDK 应用程序也使用相同的 ) 。

出现错误的原因是客户名 ID 444837786259-8vsffg8dnl2s8hvoeiu8v0laqqqc5p2p.apps.googleusercontent.com 没有注册重定向 URIs。 如果您尝试 444837786259.apps.googleusercontent.com , 它应该有效 。

问题回答

暂无回答




相关问题
Microsoft partner API: can t authenticate

I ve created an app in Azure AD and followed this steps (Application and user access): https://github.com/MicrosoftDocs/partner-rest/blob/docs/partner-rest/develop/api-authentication.md From what I ...

Oath+Twitter IPhoneSDK

Does anyone know of a good example utilizing the twitter API and Oauth authentication for sending Twits iPhone SDK ........... I got stuck @ sending the twits .........I can make a successful login ...

Can t get user info from Facebook with OAuth 2.0

As soon as the user is logged in, I retrieve the user info using this code: [_facebook requestWithGraphPath:@"me" andDelegate:self]; It worked for the first few times, but it eventually returned an ...

热门标签