x1ddos / simpleauth

Simple authentication for Python on Google App Engine supporting OAuth 2.0, OAuth 1.0(a) and OpenID

Home Page:https://simpleauth.appspot.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support Twitter REST API v1.1.

andornaut opened this issue · comments

When attempting to authenticate via Twitter, the last lines fails with an error due to 'screen_name' not being present in uinfo.

    resp, content = client.request(
      'https://api.twitter.com/1/account/verify_credentials.json'
    )
    uinfo = json.loads(content)
    uinfo.setdefault('link', 'http://twitter.com/%s' % uinfo['screen_name'])

uinfo is actually an error message:

The Twitter REST API v1 is no longer active. Please migrate to API v1.1. https://dev.twitter.com/docs/api/1.1/overview.

It'd be great if simpleauth could be updated to support the new Twitter REST APi version.

I see that this has been fixed in the current git head. Please consider releasing a new version to pypi. Thanks.