YouTube OAuth: Why do some accounts provide me with "Invalid credentials"?

I use OmniAuth in Rails to authenticate users through OAuth YouTube.

I have several Google / YouTube accounts. Two of them are logged in. Two of them fail with "invalid_credentials".

I'm not quite sure what this error means; it does not appear in the OAuth 2 spec .

I successfully logged in to all four of these accounts on the Google side using multiple sign-in, so this is not what I'm registering incorrectly. Two accounts work, so it's not that my API key is bad.

What's happening?

0
source share
1 answer

I have an answer.

They return invalid_credentialsbecause there is no YouTube account associated with the user trying to log in.

But! I tried logging into YouTube with these accounts before trying to log into my application. It turns out that this is not enough.

In this bold new world, Google users can log into YouTube without actually creating a YouTube account. In the YouTube user interface, a YouTube account is a "channel." You can now log into YouTube and not have a channel.

To create a channel, click the user menu (represented by your profile) in the upper right corner of the page and click "My channel". You will be prompted to create it.

You can then log in using OAuth YouTube.

+7

Source: https://habr.com/ru/post/1533661/


All Articles