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

issue authenticating #254

Open birchlore opened 8 years ago

birchlore commented 8 years ago

I'm getting the error:

YouTubeIt::AuthenticationError: BadAuthentication

I just want to confirm my authentication details:

@client = YouTubeIt::Client.new(:username => "my_youtube_acount@gmail.com", :password => "password_to_gmail", :dev_key => "youtube_api_credentials_key")

So,

  1. :username is my full gmail address? or just the name before @gmail.com? Or something else?
  2. :password is the password to above gmail account?
  3. :dev_key is a youtube_data server API key that I've generated from https://console.developers.google.com/apis/credentials

Does that all look right? Why would I be getting an authentication error? I've verified the credentials manually several times.

birchlore commented 8 years ago

Turns out I had to go into my google profile settings to allow less secure apps to have access (I guess apps that don't use Oauth?)

screen shot 2016-03-17 at 4 33 42 pm
pickhardt commented 8 years ago

To confirm, @birchlore, this issue can be closed?

birchlore commented 8 years ago

Hey @pickhardt yep, thanks! A note could be added to the readme if anyone else mentions it.

flyingdeath commented 6 years ago

I'm getting a 'AuthenticationError' when accessing current_user. So the code looks like:

client = YouTubeIt::Client.new(:username => params['user'],:password => params['pass'], :dev_key => dev_key) begin if client.current_user # 'AuthenticationError' here at runtime end session['user'] = params['user'] session['pass'] = params['pass'] redirect_to :controller => "mainpage", :action => "search" rescue session['user'] = nil session['pass'] = nil redirect_to :controller => "login", :action => "index" end