Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

对接google登录踩坑 #92

Open
lizhongzhen11 opened this issue May 10, 2020 · 0 comments
Open

对接google登录踩坑 #92

lizhongzhen11 opened this issue May 10, 2020 · 0 comments

Comments

@lizhongzhen11
Copy link
Owner

我的网站需要支持google等第三方登录,本来以为很简单,没想到也搞了我一下午。

问题来了

需要有 apiKeyclientIddiscoveryDocs 直接用示例里面的,scope 要换成自己想用的。

apiKey 和 clientId 怎么来?

看图:

我TM没看清,以为 客户端ID 里面的key是 apiKey,结果调用具体方法时一直报 key 不合法,这个破问题困扰了我要有近3个小时,后来我才发现,原来 apiKey 是另外一个,草草草,真是fuck!

接下来就简单了,我只需要登录用户的 id 和 名称,所以将方法换成 https://developers.google.com/people/api/rest/v1/people/get 即可

需要注意!!!控制台发现调用获取用户信息的url和官方测试工具显示的HTTP不同,我一直以为我的问题在这里,苦思冥想,其实是我apiKey错了,控制台的url和官方不同没关系。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant