If I do the following:
<cflocation url="https://accounts.google.com/o/oauth2/auth?scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email&client_id=#Application.Google.client_id#&redirect_uri=http%3A%2F%2Fwww.PhillipSenn.com%2FLR%2FGoogle%2FCallback&response_type=code" addtoken="no">
Then I get the “Allow Access” and “No Thanks” screen correctly.
I then Allow Access, and my callback screen is called correctly.
Q: What do I do now? I need to ascertain the email address of the user.
The only thing I see is: url.code, which doesn’t look usable.
Do I have to then call
https://www.googleapis.com/oauth2/v1/userinfo
using something called an access_token? I don’t think so because that’s talking about JavaScript, and I’m doing all this server side. And besides, I don’t need the user profile information – I just need their email address.
Edit:
This link looks promising.
That call gives you
access_tokenwhich allows you (for a limited time) access user information. It does not matter where you use it, server side is ok.Just make sure your request to
https://www.googleapis.com/oauth2/v1/userinfohasaccess_token=youraccess_tokenas a parameter