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

Implement OAuth2 token refresh #492

Closed
omab opened this issue Oct 17, 2012 · 7 comments
Closed

Implement OAuth2 token refresh #492

omab opened this issue Oct 17, 2012 · 7 comments

Comments

@omab
Copy link
Owner

omab commented Oct 17, 2012

Like the one in this snippet for google-oauth2 https://gist.github.com/3906451

@ulyssesv
Copy link
Contributor

+1!

@arnaudbreton
Copy link

Would be really really cool ! I received a lot of error due to users that changed their password !

@lisongx
Copy link
Contributor

lisongx commented Nov 22, 2012

+1

On Thu, Nov 22, 2012 at 10:43 PM, arnaudbreton notifications@github.comwrote:

Would be really really cool ! I received a lot of error due to users that
changed their password !


Reply to this email directly or view it on GitHubhttps://github.com//issues/492#issuecomment-10636406.

Best regards,
Sean Lee

@omab omab closed this as completed in c55abfa Dec 11, 2012
@arnaudbreton
Copy link

An exception is raised each time I call the method "refresh_token" with Facebook backend.

Here's the stacktrace:

 File "/app/UniShared_python/website/tasks.py", line 243, in facebook_friends_joined_task
    user_social.refresh_token()

  File "/app/.heroku/python/lib/python2.7/site-packages/social_auth/db/base.py", line 44, in refresh_token
    response = backend.refresh_token(token)

  File "/app/.heroku/python/lib/python2.7/site-packages/social_auth/backends/__init__.py", line 857, in refresh_token
    dsa_urlopen(request).read()

  File "/app/.heroku/python/lib/python2.7/site-packages/social_auth/utils.py", line 254, in dsa_urlopen
    return urlopen(*args, **kwargs)

  File "/app/.heroku/python/lib/python2.7/urllib2.py", line 126, in urlopen
    return _opener.open(url, data, timeout)

  File "/app/.heroku/python/lib/python2.7/urllib2.py", line 406, in open
    response = meth(req, response)

  File "/app/.heroku/python/lib/python2.7/urllib2.py", line 519, in http_response
    'http', request, response, code, msg, hdrs)

  File "/app/.heroku/python/lib/python2.7/urllib2.py", line 444, in error
    return self._call_chain(*args)

  File "/app/.heroku/python/lib/python2.7/urllib2.py", line 378, in _call_chain
    result = func(*args)

  File "/app/.heroku/python/lib/python2.7/urllib2.py", line 527, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)

HTTPError: HTTP Error 400: Bad Request

Thanks for your help!
Let me know if I can do something to help..
Arnaud.

@kennyledet
Copy link

^ I know this is extremely late, but have you specified that you want 'offline_access' in FACEBOOK_EXTENDED_PERMISSIONS in your settings file?

@goldsmith
Copy link

+1 to 'offline_access'. For Google OAuth2, I just added the line

GOOGLE_OAUTH2_AUTH_EXTRA_ARGUMENTS = {'access_type':'offline'}
to my settings.py, and everything started working.

@fierroformo
Copy link

I have a error:

ImportError: cannot import name dsa_urlopen

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

7 participants