Hi, 

Could you check if the access_type 
<https://developers.google.com/identity/protocols/OAuth2WebServer#request-parameter-access_type>
 parameter 
is set to "offline" in your request? The refresh token is only returned if 
your application sets the access_type parameter to "offline" in the initial 
request to Google's authorization server when using Web application type 
credentials. Refresh tokens are always returned for installed applications, 
which is the reason you were receiving the refresh token when testing on 
localhost with an Installed application type credential. Please try this 
out and let me know if you are able to generate a refresh token. 

The customerId will not be returned in the response from the OAuth server 
when you generate a refresh token. Instead, you need to make a 
CustomerService.getCustomers() 
<https://developers.google.com/adwords/api/docs/reference/v201609/CustomerService#getcustomers>
 
request like you do in the code snippet in your earlier post. 

To retrieve the email address, you need to include the scope: "
https://www.googleapis.com/auth/userinfo.email"; as mentioned in this 
<https://developers.google.com/identity/protocols/googlescopes#oauth2v2> 
document. 
If this scope is included while you generate the refresh token, you should 
be able to get the email address of the authenticating user by making the 
following request: 

https://www.googleapis.com/oauth2/v2/userinfo?access_token=
"YOUR_ACCESS_TOKEN".


You can try this out in the API explorer 
<https://developers.google.com/apis-explorer/#p/oauth2/v2/oauth2.userinfo.get>
.

Regards,
Shwetha, AdWords API Team.

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords 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 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/866b9175-c9a1-4027-8222-f18a4661a07a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to