Comments (9)
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.
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.
Hey @lucasvickers, how exactly did you clear out the oauth tokens in between requests? I've been running into similar issues.
from flask-oauth.
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.
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.
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.
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.
^^Thanks buds!
from flask-oauth.
I'm facing following error:
OAuthException: Invalid response from twitter
What should I do?
from flask-oauth.
Related Issues (20)
- Error: "The unauthenticated git protocol on port 9418 is no longer supported."
- Add init_db() call to example/tweet.py
- oauth session variables must be explicitly cleared before making authorize request
- call back is not set when making the authorize call HOT 4
- Consider replacing oauth2 with oauthlib HOT 1
- flask-oauth 0.13 on PyPi HOT 4
- release 0.13 on pypi HOT 4
- Consider changing to oauthlib or forking oauth2 HOT 15
- Getting ResponseNotReady() when logging in
- Example doesn't work.
- AttributeError: 'module' object has no attribute 'Client'
- Facebook data
- The urlparse module is renamed to urllib.parse in Python 3 HOT 9
- TypeError: must be string or buffer, not None, when facebook.get("me/picture?")
- pypi package not updated HOT 2
- Bearer Verification from API call
- Does this plugin support OKTA HOT 1
- urlparse library is urllib.parse in python3, urllib.quote is moved to urllib.parse HOT 1
- how to extract nodes from its response in google login response
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flask-oauth.