Code Monkey home page Code Monkey logo

Comments (9)

lucasvickers avatar lucasvickers commented on August 20, 2024 1

Sorry for missing this update,

I used the code

if session.has_key('twitter_oauth_tokens'):
    del session['twitter_oauth_tokens']

where my oauth getter/setter references that key

@twitter.tokengetter
def get_twitter_oauth_token():
    ...
    return session.get('twitter_oauth_tokens')

from flask-oauth.

lucasvickers avatar lucasvickers commented on August 20, 2024

I was having similar issue, found explicitly clearing out the oauth tokens in the session between authentication requests solved my issue. Did not find similar issue in facebook, which is why it was slightly confusing.

from flask-oauth.

xraymemory avatar xraymemory commented on August 20, 2024

Hey @lucasvickers, how exactly did you clear out the oauth tokens in between requests? I've been running into similar issues.

from flask-oauth.

yannk avatar yannk commented on August 20, 2024

fwiw, I'm seeing the same issue (with some automatic pingdom authentication to our app), I have yet to see the content of the exception (but I trapped it as I relate in #12). I'm not sure what @lucasvickers refers to, it seems that these session keys are specific to his app (flask_auth session data seems to be of the shape: self.name + '_oauthtok')

from flask-oauth.

rajbala avatar rajbala commented on August 20, 2024

I too am seeing this error if the user visits this route when they have already authenticated with twitter:

@app.route('/login/')
def login():
"""Calling into authorize will cause the OpenID auth machinery to kick
in. When all worked out as expected, the remote application will
redirect back to the callback URL provided.
"""

return twitter.authorize(callback=url_for('oauth_authorized',
next=request.args.get('next') or request.referrer or None))

I think I've worked around it by just checking for the existence of a token in the session and redirecting to an authenticated view.

from flask-oauth.

yannk avatar yannk commented on August 20, 2024

I got one instance of this exception last night. The message (data) was: "Failed to exchange tokens"
Probably some lag on twitter side.

from flask-oauth.

burnash avatar burnash commented on August 20, 2024

Just got the same issue with the callback failing with Invalid / expired Token. Resolved it with @lucasvickers advice by clearing explicitly the token in the session. Flask-OAuth==0.12

from flask-oauth.

rocapp avatar rocapp commented on August 20, 2024

^^Thanks buds!

from flask-oauth.

swapsha96 avatar swapsha96 commented on August 20, 2024

I'm facing following error:
OAuthException: Invalid response from twitter

What should I do?

from flask-oauth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.