为"googleapis.com/auth/userinfo"启用Google API; [英] Enable Google API for "googleapis.com/auth/userinfo"

查看:63
本文介绍了为"googleapis.com/auth/userinfo"启用Google API;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发Google Chrome扩展程序.我希望能够使用来自这些端点的数据来访问用户个人资料信息:

I am developing a Google Chrome Extension. I would like to be able to access the user profile info, using the data from these endpoints:

https://www.googleapis.com/auth/userinfo

https://www.googleapis.com/oauth2/v1/userinfo

我似乎无权访问这些资源.从我的网络搜索看来,我可能需要在Google Developers Console中启用库API.但是我到那里去了,找不到合适的API来启用.有谁知道我应该启用哪个API?

I don't seem to have access to these resources. From my web searches, it looks like I may need to enable a library API in the Google Developers Console. But I looked there and cannot find an appropriate API to enable. Does anyone know which API I should enable?

推荐答案

如果您有来自用户的访问令牌,则可以从这些终结点检索数据.首先,您必须通过让用户使用 google login API 登录来获取访问令牌.然后从以下链接检索数据. https://www.googleapis.com/oauth2/v1/userinfo?access_token= PUT_YOUR_USER 'S_ACCESS_TOKEN_HERE

You can retrieve data from these endpoints if you have an access token from the user. First, you have to get an access token by letting the user login using google login API. Then retrieve the data from the following link. https://www.googleapis.com/oauth2/v1/userinfo?access_token=PUT_YOUR_USER'S_ACCESS_TOKEN_HERE

这篇关于为"googleapis.com/auth/userinfo"启用Google API;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆