Questions tagged [flask-dance]

Use this tag when using the Flask-Dance package in Python.

45 questions
4
votes
0 answers

Dash Cognito Authentication Logout

I have managed to use this package here to authorize login for my users. However, I am having trouble designing a logout system. So far, what I’ve done is code up the following method in the class defined here. It essentially calls the revoke…
2
votes
0 answers

Flask-dance Google oauth setup issue with pythonanywhere

I am trying to set up Google login for my webapp with Flask-dance. The problem is with setting the 'Authorized redirect uri' in the Google Developer's console as https://moneycare.pythonanywhere.com/google/authorized. I get an error 'Invalid…
debashish
  • 1,374
  • 1
  • 19
  • 29
2
votes
1 answer

Discord API 401 Unauthorized Error when trying to get guild roles

So what I'm trying to do is I'm creating some kind of dashboard for my bot and I want to get the current guilds roles. When I try to do that, I get {'message': '401: Unauthorized', 'code': 0} as response. I tried everything and looked at multiple…
Emir Sürmen
  • 884
  • 3
  • 14
  • 33
2
votes
1 answer

Flask-Dance SQLAlchemy integration not working

I'm using Flask-Dance to use Google to login to my application. I am also using SQLAlchemy and Flask-Login. Everything regarding the Google login is working perfectly but it is supposed to save the token data in a table created by SQLAlchemy…
plasmy
  • 99
  • 3
  • 9
  • 32
2
votes
1 answer

flask dance Azure AD authentication token expired exception

I have set up a Python flask website with Azure AD authentication. The site works well and correctly authenticates me as an AD user signing onto the site. However, after a period of time, the AD authentication expires, and instead of what I'd expect…
JamesMatson
  • 2,522
  • 2
  • 37
  • 86
2
votes
1 answer

Google oauth - getting the user email

I am using Flask dance in order to authenticate users (using Google as auth provider) I try to get the user email and tried few options - non of them returned the email. Code snippet:(google is flak-dance Google blue print) if not…
balderman
  • 22,927
  • 7
  • 34
  • 52
2
votes
1 answer

Flask-Dance: No module named 'flask_dance.consumer.backend'

That's my very first question here, please don't eat me! I am totally newbie, I try to write a flask app using flask-dance for OAuth reason. Seems I do something stupid, because when I try to import SQLAlchemyBackend class from…
Igor
  • 35
  • 8
1
vote
0 answers

How to resolve "MismatchingStateError: (mismatching_state) CSRF Warning!" when using Github Authentication in a Flask App?

I am using the Flask-Dance package for logging in to my app via Github and I've configured it in my project but I get this error in response: oauthlib.oauth2.rfc6749.errors.MismatchingStateError: (mismatching_state) CSRF Warning! State not…
mosi
  • 39
  • 9
1
vote
1 answer

How to enable redirect mode for Google login button?

I'm setting up a Google login option using flask-dance. My route I've create "http://localhost/login/google" successfully directs you to sign in with google and returns a json with information. Now I need to enable a link for users to get there.…
Rug
  • 13
  • 4
1
vote
0 answers

Having trouble importing flask dance into pyCharm

I'm trying to build an a login page for an application using github oauth and flask_dance. When I try to run the following code I keep getting an error saying that flask_dance could not be found, even though it's installed on this device. try: …
1
vote
1 answer

How do I implement OAuth with Discord using flask dance?

I used the same code for google oauth and I used flask-dance. This worked with google, but didn't work with discord. I get an error message saying that I need to be logged in to reach the home page, meaning that the discord account hasn't been…
1
vote
1 answer

how to implement Flask-Dance with Flask Blueprints

I tried to use Flask-Dance with normal flask app and it works and if I try to implement with flask blueprints it doesn't work. How to register flask-dance to flask blueprints? My views.py for auth blueprint from flask import render_template,…
1
vote
0 answers

SQLAlchemy Integrity Error UNIQUE constraint failed: users.login

I'm making a web dashboard using Flask and it has Discord login (Flask-Dance). The code gives me this error: sqlalchemy.exc.IntegrityError: (sqlite3.IntegrityError) UNIQUE constraint failed: users.login. The code works completely fine if the user is…
Emir Sürmen
  • 884
  • 3
  • 14
  • 33
1
vote
0 answers

Flask-Dance can't put more than one row in cache database

Flask-Dance cannot add entries more than 1. This also causes people to login into others accounts. This is how the db looks like all the time: We are using sqlalchemy to cache user logins. dbsl = SQLAlchemy() d_oauth =…
Emir Sürmen
  • 884
  • 3
  • 14
  • 33
1
vote
0 answers

Custom Oauth token storage for flask-dance with mongoengine

I'm trying to implement a Custom Token storage that works with MongoDB and stores a session token of flask-dance. See here for more details: https://flask-dance.readthedocs.io/en/latest/storages.html Does someone know how to do this?
BugsBuggy
  • 115
  • 1
  • 9
1
2 3