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.

Support oauth2client >= 2.0 for service accounts

See original GitHub issue

The function oauth2client.client.SignedJwtAssertionCredentials() (called in ServiceAccountCredentials() in ee/_helper.py) was removed in versions >=2.0 of oauth2client (changelog). This causes the the following exception to be raised when trying to initialize EE with service account credentials using newer versions of oauth2client:

return oauth2client.client.SignedJwtAssertionCredentials(
AttributeError: 'module' object has no attribute 'SignedJwtAssertionCredentials'

Typically I roll back oauth2client to 1.5.2, but other modules (like gcloud) rely on the newer version of oauth2client, which makes it difficult to use both modules in the app.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
jonas-eberlecommented, Aug 19, 2016

Hi, I discovered the same issue and wrote a workaround in my application based on the issue #401 you have referenced.

Instead of calling authorization = ee.ServiceAccountCredentials(MY_SERVICE_ACCOUNT, MY_PRIVATE_KEY_FILE) ee.Initialize(authorization)

you can use the following from oauth2client.service_account import ServiceAccountCredentials from ee import oauth authorization = ServiceAccountCredentials.from_p12_keyfile(MY_SERVICE_ACCOUNT, MY_PRIVATE_KEY_FILE, scopes=oauth.SCOPE) ee.Initialize(authorization)

0reactions
tylerecommented, Jul 28, 2017

Given that it works with the preferred JSON key format and the current Python API release, I would suggest closing it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using OAuth 2.0 for Server to Server Applications | Authorization
To support server-to-server interactions, first create a service account for your project in the API Console. If you want to access user data...
Read more >
oauth2client.service_account module
Service Account credential for OAuth 2.0 signed JWT grants. Supports. JSON keyfile (typically contains a PKCS8 key stored as PEM text) .p12 key...
Read more >
How to Use Google OAuth 2 With a Service Account - Soliant
Learn how to leverage Google OAuth 2 with a service account for your business application from experienced developers at Soliant Consulting.
Read more >
Setting up OAuth 2.0 - Google Cloud Platform Console Help
To use OAuth 2.0 in your application, you need an OAuth 2.0 client ID, which your ... For information about setting up service...
Read more >
Create short-lived credentials for a service account
The following credential types are supported: OAuth 2.0 access tokens; OpenID Connect ID tokens; Self-signed JSON Web Tokens (JWTs); Self-signed binary objects ...
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