I have an integration with YouTube to return captions to videos of different YouTube accounts, and I use the YouTube API for this.
The thing is that some accounts are not being authorized to return captions. I made some investigation and I noticed some stuffs:
The oauth app seems to intermittently give an unverified warning to users trying to authorize the application to access their youtube account via api;
Even the users authorizing their accounts, when I try to return the captions I get an unauthorized message;
By digging more, I noticed that the access token had its expiration date to the moment of authorization.
The token is not being refreshed, which should be done by the refresh token, and seems to be not working.
Did someone had problems like that? How did you solved? I already tried to get in touch with YouTube support, but they could not give me a solution or a path to do a better investigation.
I was trying getting in touch with YouTube, but it seems that their technical support only replies on Stackoverflow.
Google saying that the app was not verified
Status of verified application
Related
I have a google account that I was previously uploading videos to using the v2 YouTube API. This account I guess has two accounts linked to it, because when I go through OAuth flows I have to choose which account.
The 1st account, the one I setup the API in developer console, gives me the option to authorize YouTube API controls.
The 2nd account, the one that actually is the YouTube channel, only says that I'm giving my application offline access, there is no permissions specified relating to YouTube.
I did my OAuth using the 1st account, since that one actually listed youtube permissions. Got my refresh token and added it to the application. However, when I go to attempt to insert a video to YouTube I get the following error:
Code 401 Unauthorized: youtubeSignupRequired
It's as though I'm not linking at all to the YouTube channel account even though they are both on the same Google account.
Has anyone encountered this before?
By the way, I know with certainty that my API calls work properly, as we were able to upload from the dev environment. The dev account is only a single account though that owns the channel on the same account as the API.
I was able to resolve this.
It turned out I needed to do the OAuth with the 2nd account, the one for the YouTube channel. Despite it not requesting any permissions related to YouTube and only getting offline access, I was able to successfully upload using the refresh token I received.
Definitely a case of the most illogical solution being the correct one.
I'm uploading videos to many customers using Google API v3 with PHP client lib, it works for most of them so I guess the issue is not in my code.
For the customers that fail, it always fails, so I believe the problem is with their authentication, however, for these customers I do get categories list with no problem, it's just the video upload that failed.
That made me think it's because of the scopes I used during the authentication, but I used the same scopes for all my customers, those that work and those that don't.
Any idea?
Thanks,
Tan-Tan
A couple of years ago, YouTube accounts changed and became integrated with Google+. After that point, all new accounts were actually Google+ accounts with a linked YouTube channel; however, YouTube accounts that were created before that changeover needed to manually log in and link their YouTube account to their Google+ account. When you try to use the YouTube API to upload a video, if they have one of these legacy accounts that they haven't manually linked, you'll get the error message that you're experiencing.
There's no API call to do the linking for them; so if your app gets that message, you'll have to redirect them to http://m.youtube.com/create_channel and have them link their accounts.
I'm currently working on a YouTube app that will allow users to Log In with their Google Accounts so they can subscribe to other YouTube channels and Like/Dislike videos. However Google doesn't seem to give me access to their YouTube channels even though that option is turned on.
As you can see here the YouTube API is turned on
However when the user is presented to use my App with his account it doesn't ask the user for access to the YouTube channel.
When you look at other applications you can see that they ask for permission for their channel.
Has anyone experienced something similar or does anyone know if I'm doing something wrong :( ?
This looks like a case of your app not passing the proper scope when doing the oAuth authentication. In your code, where your client sets the oAuth scopes, make sure that this is one of the ones you're passing:
https://www.googleapis.com/auth/youtube
Rephrasing of the question:
Using the youtube api v 3.0 with oauth, when the user is sent to login, they have more than one option: e.g. the linked youtube account and the google account. The two different logins (access tokens) have different access to the api. I need the ability to just sent the user to log in to their proper youtube account (if they have one). How can my app do this? The user currently will have no idea which option they are supposed to choose, even if the app might be able to tell which they have chosen afterwards.
https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=1056190619576.apps.googleusercontent.com&redirect_uri=urn:ietf:wg:oauth:2.0:oob&scope=https:%2F%2Fwww.googleapis.com%2Fauth%2Fyoutube
original phrasing of the question:
OK, this is getting really really confusing. My youtube account uses a gmail, so I think that it is safe to say that it is linked to my google account (if such a thing linkage does exist). A couple of days ago I was on youtube, and the web site roped me into giving my youtube account its own google+ account (as far as I could tell). My gmail/google account does not have google+. Anyway, shortly thereafter I undid the linking of a google+ account to the channel. Ominously, at this point youtube indicated that this was only temporary.
And the net effect of this is: I can't use the youtube api with the youtube account. It says nolinkedyoutubeaccount .
So, the youtube api seems unusuable to me. This confusion is enough to make a person's head spin. But can anyone suggest a solution to get my account working with the api again?
Edit: I have managed to reproduce the error (more or less) with a newly opened youtube account. More here: https://code.google.com/p/gdata-issues/issues/detail?id=4860
These blog posts should help explain what's going on
http://apiblog.youtube.com/2013/06/google-page-identities-and-youtube-api.html
http://youtubecreator.blogspot.com/2013/04/using-google-page-identity-on-youtube.html
Based on what you describe, I think things are working as intended, but you do need to be careful to ensure that you select the correct channel when going through the OAuth 2 flow.
Is anyone else seeing the following issue?
For older youtube accounts we can request an AuthSub token and upload to those accounts no problem.
For new youtube accounts we can request an AuthSub token, but when we try to upload to that account we get an 'Unauthorized' error
We are planning to eventually migrate to OAuth 2.0, but I'd like to know if this is a known issue
Answering this incase anyone wanders here
Okay I'll file this under 'what the heck'
Turns out even if you load youtube and are signed in via your google ID.... you might not have a youtube account. I had to load 'http://www.youtube.com/create_channel' to create a channel/username to be able to make these API calls.
Why the heck does the login screen return an AuthSub token when the user has no account?!? As far as my user was concerned it looked like they have an account. YouTube loaded with their e-mail at the top and looks like a valid youtube login!
Thanks,
B.