Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3638

Youtube API not returning refresh_token and instead returning id_token

$
0
0

For like a week now, I have been unable to process Google OAuth for the youtube API.

When I request authorization like this:

http://accounts.google.com:443/o/oauth2/v2/auth?state=STATE&client_id=CLIENT_ID&redirect_uri=REDIRECT_URI&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fyoutube+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fyoutube.force-ssl+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email&access_type=offline

The scopes are clearly defined without openid.

However, on callback this is what comes back

/youtube/auth/callback?state=STATE&code=CODE&scope=email+profile+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fyoutube.force-ssl+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fyoutube+openid&authuser=0&prompt=none

Open ID has been added to the scopes

When code exchange for tokens is done, the response now include id_token instead of refresh_token and the scope are different (persistently)

{"access_token"=>"ACCESS_TOKEN", "expires_in"=>3599, "scope"=>"https://www.googleapis.com/auth/youtube.force-ssl https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/youtube openid", "token_type"=>"Bearer", "id_token"=>"ID_TOKEN"}

What cause this?


Viewing all articles
Browse latest Browse all 3638

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>