Extracting Gmail username with OAuth access token

2019-05-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.

标签: oauth gmail imap
2条回答
▲ chillily
2楼-- · 2019-05-14 08:11

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.

查看更多
家丑人穷心不美
3楼-- · 2019-05-14 08:20

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.

查看更多
登录 后发表回答