Extracting Gmail username with OAuth access token

半城伤御伤魂 提交于 2019-12-07 14:07:44

问题


I'm using OAuth to get a user to grant me access to their Gmail IMAP account. I can successfully get an access token, and need to know what endpoint I can access to get the authenticated user's e-mail address.


回答1:


And you can test this feed using Google's OAuth Playground, as I just did.

In step one, paste the scope:

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

And in step six, paste the feed URI:

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

This should help in adapting the feed for use in your own application.




回答2:


You can get user's username and email with endpoint: https://www.googleapis.com/userinfo/email with scope: https://www.googleapis.com/auth/userinfo#email.



来源:https://stackoverflow.com/questions/5794715/extracting-gmail-username-with-oauth-access-token

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!