question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Oauth2 credentials not working

See original GitHub issue

Today a deprecation warning prevent me from starting my script so after I follow this instructions but after running my script got this error

 File "main.py", line 12, in <module>
    credentials = SignedJwtAssertionCredentials(json_key['client_email'],json_key['private_key'], scope)
  File "/home/oscar/.virtualenvs/google/lib/python3.4/site-packages/oauth2client/util.py", line 137, in positional_wrapper return wrapped(*args, **kwargs)

File "/home/oscar/.virtualenvs/google/lib/python3.4/site-packages/oauth2client/client.py", line 1458, in __init__
    _RequireCryptoOrDie()
  File "/home/oscar/.virtualenvs/google/lib/python3.4/site-packages/oauth2client/client.py", line 1412, in _RequireCryptoOrDie
    raise CryptoUnavailableError('No crypto library available')
oauth2client.client.CryptoUnavailableError: No crypto library available

here the error is clearly because there’s not crypto library but then I install pyopenssl ( I’ve try with both disto and pip packages ) the next error appears

Traceback (most recent call last):
  File "main.py", line 12, in <module>
    credentials = SignedJwtAssertionCredentials(json_key['client_email'],json_key['private_key'], scope)
  File "/home/oscar/.virtualenvs/google/lib/python3.4/site-packages/oauth2client/util.py", line 137, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "/home/oscar/.virtualenvs/google/lib/python3.4/site-packages/oauth2client/client.py", line 1469, in __init__
    self.private_key = base64.b64encode(private_key)
  File "/home/oscar/.virtualenvs/google/lib/python3.4/base64.py", line 62, in b64encode
    encoded = binascii.b2a_base64(s)[:-1]
TypeError: 'str' does not support the buffer interface

I’m stuck in here.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:14 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
burnashcommented, Apr 24, 2015

@oinirio try to share this spreadsheet with an email address listed in your credentials.

0reactions
jbjbrocommented, Jul 2, 2015

@mdalpi Thanks! Using GOOGLE_APPLICATION_CREDENTIALS Works on openwrt-yun. For those trying to use gspread on the Yun, it seems the pyopenssl version is too old (version 0.10 on Yun) and apparently oauth2client calls the method sign from pyopenssl which is undefined so using SignedJwtAssertionCredentials breaks.

For the environment variable, you must add the following line to the configuration file /etc/profile then restart: export GOOGLE_APPLICATION_CREDENTIALS=“/path/to.json”

Read more comments on GitHub >

github_iconTop Results From Across the Web

OAuth2 not working : Authentication failure · Issue #946 - GitHub
TheHive is running as HTTP. I did not set up SSL nor reverse proxy on the server. From an authorization code grant flow...
Read more >
oauth 2 to authenticate users stopped working suddenly in all ...
We have application on compute engine that is using oauth2(Using GCP credentials) to authorize users to access application and ...
Read more >
Using OAuth 2.0 to Access Google APIs | Authorization
Basic steps · 1. Obtain OAuth 2.0 credentials from the Google API Console. · 2. Obtain an access token from the Google Authorization...
Read more >
IMAP OAuth2 with client credentials authentication failed
The problem is when I try to authenticate using this access token in Java, for example. Properties props = new Properties(); ...
Read more >
Possible Errors - OAuth 2.0 Simplified
Unrecognized client_id. If the client ID is not recognized, the authorization server will not redirect the user. Instead, it may display a ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found