YouTube Oauth2 token problems
I am wanting to get the current logged in YouTube users details for my site.
After some playing around, I found a way.
The problem is, depending on my "scope" parameter, I do not get all what I
should be getting.
So here is an echo of some info I am looking at.
Author code:
xxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxx
RESULT code:
"{ "access_token" : "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "token_type" :
"Bearer", "expires_in" : 3599 }"
channelId: xxxxxxxxxxxxx
userId: xxxxxxxxxxxxxxxxx
username: xxxxxxxxx
displayname: XxxxxxxXxxxx
So all looks good??? Well no. For my immediate needs it will do, but not
for long term.
The issue is as mentioned, the "scope" parameter. If I set it to
scope=https://www.googleapis.com/auth/youtube
I can access the info, but it does not log it in the "Authorised Access"
list in my Google account.
But if I set the scope to
scope=https://www.googleapis.com/auth/youtube.readonly
it will log the access, but then I cant get the user info.
I will be needing to have it log the user as authorised as well as get
their channel info so that I can get my refresh token for later
developments.
No comments:
Post a Comment