youtube_it icon indicating copy to clipboard operation
youtube_it copied to clipboard

issue authenticating

Open birchlore opened this issue 8 years ago • 4 comments

I'm getting the error:

YouTubeIt::AuthenticationError: BadAuthentication

I just want to confirm my authentication details:

@client = YouTubeIt::Client.new(:username => "[email protected]", :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 avatar Mar 17 '16 19:03 birchlore

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

birchlore avatar Mar 17 '16 23:03 birchlore

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

pickhardt avatar Aug 15 '16 05:08 pickhardt

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

birchlore avatar Aug 15 '16 14:08 birchlore

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

flyingdeath avatar Oct 04 '18 21:10 flyingdeath