Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

please update your docs on setting up google oauth #343

Closed
marcmaxson opened this issue Jan 10, 2016 · 5 comments
Closed

please update your docs on setting up google oauth #343

marcmaxson opened this issue Jan 10, 2016 · 5 comments

Comments

@marcmaxson
Copy link

marcmaxson commented Jan 10, 2016

it says that PyOpenSSL may be required, but I find that with python 2x it is absolutely required. The error message you get back does not make the source of the problem clear:

from oauth2client.client import SignedJwtAssertionCredentials
returns ImportError: cannot import name SignedJwtAssertionCredentials

looking on stackoverflow, I found:
http://stackoverflow.com/questions/14063124/importerror-cannot-import-name-signedjwtassertioncredentials

that oauth2client depends on PyOpenSSL but doesn't tell the user it does, so best to let people know in your otherwise exquisite documentation what this error message means.

Libraries oauth2client.client

if HAS_OPENSSL:
  # PyOpenSSL is not a prerequisite for oauth2client, so if it is missing then
  # don't create the SignedJwtAssertionCredentials or the verify_id_token()
  # method.

thanks!

@voscausa
Copy link

SignedJwtAssertionCredentials was removed here
Example code using ServiceAccountCredentials:

import webapp2
from oauth2client.service_account import ServiceAccountCredentials
import gspread

SCOPES = ['https://spreadsheets.google.com/feeds']

class GssHandler(webapp2.RequestHandler):
    """ replaces the SignedJwtAssertionCredentials """

    def get(self):

        credentials = ServiceAccountCredentials.from_json_keyfile_name('voscausa-sa-test.json', SCOPES)
        gss_client = gspread.authorize(credentials)
        gss = gss_client.open('test-gspread')
        worksheet = gss.sheet1
        self.response.write(worksheet.acell('A1').value)

To make in work in the appengine dev_server I installed:

  • httplib2 0.9.2
  • gspread 0.3.0
  • oauth2client 1.5.2
  • requests 2.3.0
  • pyasn1 0.1.9
  • payasn1-modules 0.0.8
  • rsa 3.3
  • six.py 1.10.0

@thebestmensch
Copy link
Contributor

Please see my correction to their documentation here. This will solve your problem.

vmahedia added a commit to vmahedia/gspread that referenced this issue Mar 16, 2016
…oses burnash#357, closes burnash#356

SignedJwtAssertionCredentials is deprecated, replaced that with
new method with reads credentials directly from the file.

googleapis/oauth2client#401
@burnash
Copy link
Owner

burnash commented Dec 12, 2016

@marcmaxson since SignedJwtAssertionCredentials was removed is the issue still relevant?

@burnash
Copy link
Owner

burnash commented Dec 12, 2016

@marcmaxson sorry I overlooked, it wasn't actually removed.

@burnash
Copy link
Owner

burnash commented Mar 30, 2020

Fixed in #356

@burnash burnash closed this as completed Mar 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants