kylejginavan / youtube_it

An object-oriented Ruby wrapper for the YouTube GData API
http://groups.google.com/group/ruby-youtube-library
595 stars 223 forks source link

AuthenticationError (BadAuthentication) in production environment with youtube new accounts #208

Open hyperrjas opened 10 years ago

hyperrjas commented 10 years ago

In my dev environment with localhost:3000 my new google plus username and password does works fine. I'm getting these data from google page settings:

screen

If you are using this new google plus settings, you must set up a new password from this page and use this password and this username in your youtube_it.yml file.

However when I try upload a video from my production domain I'm getting this error:

Completed 500 Internal Server Error in 263.8ms
AuthenticationError (BadAuthentication):

Thanks

gnapse commented 9 years ago

I'm getting AuthenticationError: BadAuthentication always. Just cloned the sample app, bundle install, rake db:migrate and rails s.

Whenever I try to upload a video, I get AuthenticationError: BadAuthentication. So I have to ask, although it seems to me like a silly question: what is the username and password that I have to put in the config/youtube_it.yml file? I assume it's something like:

common: &common
  dev_key: "my-developer-key"
  username:  "xxxxxx@gmail.com"
  password:  "my-gmail-password"

Or is it something else?

gnapse commented 9 years ago

I found what was the problem. I have two-step authentication enabled on my google account, so the API client did not work with my regular password. I had to generate an app-specific password for it.

jonasmora commented 9 years ago

@gnapse did the api client work in dev with localhost:3000 even thought you had the two-step authentication?

I'm not sure about this, but I think that when the app tries to log in from production it's very likely that the server is in a different place than your computer and the sign-in is prevented by google.

https://security.google.com/settings/security/activity

gnapse commented 9 years ago

I don't know about production. I was using my own credentials just to test the app, on a development environment on localhost:3000. Probably on production it wouldn't work the same, but I never intended to use my own account with two-step auth in production.