You have a few options.

If you ONLY need some user id then Google's OAuth2 API allows you to do so. 
This user id is unique for users, and you can use it (for instance) to 
check if a user logged on before. Or for communicating with Google.

If you need more, like the actual email address, then you also have an 
option: When the user is about to log on, you have to pass a so-called 
scope to the OAuth2 API. You can actually pass multiple scopes, and the 
scope for the gmail API can be among them. If you ask two scopes, and the 
user logs on and agrees, you get a single access token allowing you to 
access the account with both APIs.
So what you do, you pass the scopes for AdWords API and gmail API, and you 
use the access token (and refresh token, if necessary) for both APIs.

It has some side effects:
1. Obviously, when a user logs on, Google will ask him whether your 
software is allowed to access his AdWords account AND access his gmail 
account. Note that gmail API has multiple scopes (only reading / also 
sending / etc.), you better choose the minimal scope that provides the 
information you need.
2. When a user logs on, and you store its refresh token (for instance, to 
do large batch operations at night), do realize that this refresh token 
will be withdrawn automatically when the user changes his password. And 
possibly other options too, like reconfiguring 2FA. That behavior is 
related to gmail API, refresh tokens without access to gmail survive a 
change of passwords. (And that is not exactly true, Analytics API had the 
same behavior).
3. I am not sure if it works on accounts that are not gmail accounts. I 
would think you could still do a limited set of actions, like asking its 
properties, but I am not sure.

I hope this helps.


On Monday, October 1, 2018 at 12:35:17 PM UTC+2, Albert Paolo Rogelio wrote:
>
> Hi i want to retrieve the user info of the authenticated user.
>
> for example my login account is [email protected] <javascript:>, i want to 
> retrieve the userinfo of [email protected] <javascript:> including the 
> email. 
>
> is it possible?
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/799d310a-999c-4414-acc3-802f39364cbd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • ... Albert Paolo Rogelio
    • ... 'Peter Oliquino (AdWords API Team)' via AdWords API and Google Ads API Forum
    • ... Zweitze

Reply via email to