I send following request: 
https://accounts.google.com/o/oauth2/v2/auth?approval_prompt=force&response_type=code&client_id=xxxxxxxx-xxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com&redirect_uri=https%3A%2F%2Fpanel.piwik.pro%2Fintegrate%2Fadwords&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fadwords&access_type=offline&state=xxxx-xxx-xxx-xxx

User selects his account and authenticate my application to use his AdWords 
data. In response I get code 
https://mysite.tld/integrate/adwords?state=xxx-xxx-xxxx&code=4/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx#

And my service process this code passing it to Google SDK. Using 
`SimpleOAuth2Handler` method `GetAuthorizationUrl` is called. Goolge SDK 
then tries to obtain token sending following request, but response have no 
refresh_token.
https://www.googleapis.com/oauth2/v4/token?code=4%2Fxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&client_id=xxxxxxxx-xxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com&client_secret=xxxxx-xxxxxxxxxxxxxxxxxx&redirect_uri=https%3A%2F%2Fmysite.tld%2Fintegrate%2Fadwords&grant_type=authorization_code

Example response body:
{
 "access_token": 
"ya29.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
,
 "token_type": "Bearer",
 "expires_in": 3341
}


I use google-php-lib v201605.

How to obtain refresh_token. What do I miss?

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
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 adwords-api+unsubscr...@googlegroups.com.
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/57ac64c0-d0d1-44e7-b10e-d8a9471ab837%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • I can't obtain ... Sebastian Piskorski

Reply via email to