gspread icon indicating copy to clipboard operation
gspread copied to clipboard

AuthenticationError: Unable to authenticate. 404 code

Open gngrwzrd opened this issue 11 years ago • 15 comments

Has anyone experienced this error?

File "/Users/aaronsmith/Development/Apptitude/_epsilon/epsilon-partnersconnect/out/handlers/localization.py", line 50, in post
    gc = gspread.login(username,password)
  File "/Users/aaronsmith/Development/Apptitude/_epsilon/epsilon-partnersconnect/out/gspread/client.py", line 317, in login
    client.login()
  File "/Users/aaronsmith/Development/Apptitude/_epsilon/epsilon-partnersconnect/out/gspread/client.py", line 120, in login
    "Unable to authenticate. %s code" % ex.code)
AuthenticationError: Unable to authenticate. 404 code

The gspread library was working fine, I haven't changed anything in my code and all of the sudden I'm getting this error. I've double checked that the spreadsheet on google hasn't changed.

Not sure why this would be happening. Any ideas?

gngrwzrd avatar May 26 '15 20:05 gngrwzrd

Note, I updated to the latest version of gspread and I now get this error:

File "/Users/aaronsmith/Development/Apptitude/_epsilon/epsilon-partnersconnect/out/handlers/localization.py", line 50, in post
    gc = gspread.login(username,password)
  File "/Users/aaronsmith/Development/Apptitude/_epsilon/epsilon-partnersconnect/out/gspread/client.py", line 322, in login
    client.login()
  File "/Users/aaronsmith/Development/Apptitude/_epsilon/epsilon-partnersconnect/out/gspread/client.py", line 125, in login
    "Unable to authenticate. %s" % ex.message)
AuthenticationError: Unable to authenticate. 404: https://developers.google.com/accounts/docs/AuthForInstalledApps

Any ideas? Thanks!

gngrwzrd avatar May 26 '15 20:05 gngrwzrd

I am also experiencing this issue. Running Python 2.7.9 on Ubuntu 14.04 LTS:

Traceback (most recent call last): File "topHundred.py", line 17, in gc = gspread.login('[email protected]', '##############') File "/home/achiang/Projects/theHundreds/gspread/client.py", line 313, in login client.login() File "/home/achiang/Projects/theHundreds/gspread/client.py", line 116, in login "Unable to authenticate. %s code" % ex.code) gspread.exceptions.AuthenticationError: Unable to authenticate. 404 code

astroboi22 avatar May 26 '15 20:05 astroboi22

Email & password authentication was deprecated by Google on April 20th. You need to use oAuth2 to access your spreadsheets.

burnash avatar May 26 '15 20:05 burnash

Awesome, thank you for your prompt response!!

astroboi22 avatar May 26 '15 21:05 astroboi22

Same for me, it stopped working today. I've managed to find that was because Google deprecated the email and password login like you said.

The problem is that I tried to follow the doc to use oAuth2 here: http://gspread.readthedocs.org/en/latest/oauth2.html.

I can't manage to make the authentication to work. I thonk I'm missing something. After the tutorial done I got this error: oauth2client.client.CryptoUnavailableError: No crypto library available

I imported the "PyOpenSSL" library. Then I got this error: TypeError: 'str' does not support the buffer interface

Is it because I'm running with Python3?

joyalexandre avatar May 26 '15 21:05 joyalexandre

@joyalexandre check the issue #224 it looks like a similar problem.

burnash avatar May 26 '15 21:05 burnash

Thanks it helped me a lot. :-) Thanks for your fast support!

joyalexandre avatar May 26 '15 22:05 joyalexandre

You're welcome.

burnash avatar May 26 '15 22:05 burnash

Thanks for the support! :)

barroca avatar May 27 '15 18:05 barroca

I had this problem too. Will you be updating the library accordingly? By the way, I second the great support I've seen here.

p5a0u9l avatar May 28 '15 04:05 p5a0u9l

In python 3, one needs to read the key in binary (or bytes if you store it inline).

felagund avatar May 30 '15 10:05 felagund

Just ran into this. Btw the word "deprecated" isn't right - ClientLogin was "deprecated" (that is, discouraged, but still accessible) in 2012, and has now been disabled: https://developers.google.com/identity/protocols/AuthForInstalledApps

stevage avatar Jun 09 '15 00:06 stevage

@stevage You're right. Thank you.

burnash avatar Jun 09 '15 10:06 burnash

Hi all, i am facing with OAuth version can you please help me

request error 404: https://developers.google.com/accounts/docs/AuthForInstalledApps /home/vivek/.rvm/gems/ruby-1.9.2-p290/gems/gdata_19-1.1.5/lib/gdata/auth/clientlogin.rb:85:in get_token' /home/vivek/.rvm/gems/ruby-1.9.2-p290/gems/gdata_19-1.1.5/lib/gdata/client/base.rb:157:inclientlogin' /home/vivek/Documents/GTFS1/inc/ft.rb:10:in init' /home/vivek/Documents/GTFS1/inc/ft.rb:99:ingetTable' /home/vivek/Documents/GTFS1/inc/ft.rb:28:in update' /home/vivek/Documents/GTFS1/Rakefile:435:inblock (3 levels) in <top (required)>' /home/vivek/Documents/GTFS1/Rakefile:434:in each' /home/vivek/Documents/GTFS1/Rakefile:434:inblock (2 levels) in <top (required)>' /home/vivek/.rvm/gems/ruby-1.9.2-p290/bin/ruby_executable_hooks:15:in eval' /home/vivek/.rvm/gems/ruby-1.9.2-p290/bin/ruby_executable_hooks:15:in

' Tasks: TOP => project:deploy_fusiontables (See full trace by running task with --trace) vivek@vivek:~/Documents/GTFS1$ rake project:deploy_fusiontables 07:41:35 +0 : START Fusion Tables INSERTs rake aborted! request error 404: https://developers.google.com/accounts/docs/AuthForInstalledApps /home/vivek/.rvm/gems/ruby-1.9.2-p290/gems/gdata_19-1.1.5/lib/gdata/auth/clientlogin.rb:85:in get_token' /home/vivek/.rvm/gems/ruby-1.9.2-p290/gems/gdata_19-1.1.5/lib/gdata/client/base.rb:157:inclientlogin' /home/vivek/Documents/GTFS1/inc/ft.rb:10:in init' /home/vivek/Documents/GTFS1/inc/ft.rb:99:ingetTable' /home/vivek/Documents/GTFS1/inc/ft.rb:28:in update' /home/vivek/Documents/GTFS1/Rakefile:435:inblock (3 levels) in <top (required)>' /home/vivek/Documents/GTFS1/Rakefile:434:in each' /home/vivek/Documents/GTFS1/Rakefile:434:inblock (2 levels) in <top (required)>' /home/vivek/.rvm/gems/ruby-1.9.2-p290/bin/ruby_executable_hooks:15:in eval' /home/vivek/.rvm/gems/ruby-1.9.2-p290/bin/ruby_executable_hooks:15:in
' Tasks: TOP => project:deploy_fusiontables (See full trace by running task with --trace)

vivek2007 avatar Aug 19 '15 02:08 vivek2007

Vivek, gspread is a python library, you are using ruby.

felagund avatar Aug 19 '15 08:08 felagund