Flask-OIDC is an extension to Flask that allows you to add OpenID Connect based authentication to your website.
Questions tagged [flask-oidc]
17 questions
4
votes
1 answer
How can I remove "@oidc.login_required" for unit testing from a view?
I use flask-oidc for user login and pytest for testing. For unit testing, I would like to "remove" @oidc.require_login. How can I do that?
What I tried
The way flask-o works is roughly:
from flask import Flask, url_for, redirect
from flask_oidc…

Martin Thoma
- 124,992
- 159
- 614
- 958
4
votes
0 answers
Why do I get "'OpenIDConnect' object has no attribute 'extra_data_serializer'" with Okta+oidc?
I try to integrate Okta in my Flask application with flask-oidc. The example app works fine with my client_secrets.json, but when I integrate this in my (larger) application, I get the following error:
Traceback (most recent call last):
File…

Martin Thoma
- 124,992
- 159
- 614
- 958
3
votes
0 answers
Unable to use flask-oidc with Keycloak public client for API calls
I am trying to connect a Flask application with a Keycloak public that uses both types of endpoint decorators: @oidc.require_login and @oidc.accept_token. However I have ran into the following issue.
For a Keycloak confidential client I can access…

Gerardo Rosiles
- 31
- 5
3
votes
3 answers
OIDC SSO in flask SSL certificate verify failed
I have one flask powered app, I'm trying to enable OIDC SSO for this app. I opted for wso2 as the identity server. I have created a callback URL and added the needful things in both the Identity Server and the flask app as shown below. The app is…

skysoft999
- 540
- 1
- 6
- 27
2
votes
1 answer
Python Flask Oidc + Keycloak get groups, attribu
I'm using this example bellow to connect flask + keycloak.
Works fine, but i need get some informations about this user, like groups, attributes
Searching in flask_oid doc, i'm not find anythink about how get it.
I need it to filter after login if…

dmrpy
- 59
- 1
- 8
1
vote
0 answers
How to run a custom callback function in Flask-oidc
I have an app build in flask with keycloak for auth. It has a custom oidc callback that was once running perfectly however it will not run the custom callback function anymore. The login still works fine.
I have now gone back to basics running the…

Scott
- 11
- 1
1
vote
1 answer
Getting 'KeyError: destination' when making redirection to oAuth provider using redirect_to_auth_server()
I would like a way to activate and deactivate OIDC checks using flask-oidc.
Using the @require_login decorator is a problem as it cannot be deactivated. For instance :
g_use_oidc = True # <= A global boolean to activate or deactivate OIDC at…

Doctor
- 7,115
- 4
- 37
- 55
1
vote
0 answers
React + Flask + Flask OIDC + Keycloak + Bearer Only
I'm struggling with securing a flask API backend with flask-oidc and keycloak.
My project consist of a React front end and a flask application as REST API protected by a Keycloak server v13.0.1.
So I created a public client for the front end and a…

user3058445
- 11
- 2
1
vote
1 answer
flask application using flask_oidc with nginx reverse proxy in docker deployed on EC2 giving Not authorized error after authentication with keycloak
I have the following setup:
1: Keycloak docker container running on an EC2 instance. (I have configured it temporarily to accept http connections)
2: My Flask applicatioń together with nginx reverse proxy running in docker on another EC2 instance.
I…

Kumar Saurabh
- 711
- 7
- 7
1
vote
2 answers
Flask-OIDC | How to call a specific function after the user logged in
I built a login system using Flask OIDC and Keycloak. In my system, there is some endpoints decorated with oidc.require_login() that calls the Keycloak login page.
My goal is, after the user successfully logged in, my system checks if the user name…

Tiago Bachiega de Almeida
- 121
- 1
- 2
- 12
1
vote
0 answers
flask oidc auth callback redirects to http instead of https
This is my first attempt to deploy a plotly dash python web app. I followed below tutorials to get going
digital ocean flask app with gunicorn and nginx
Okta authentication for flask app using OpenIdConnect
The app runs fine on an ec2 instance…

AlwaysConfused
- 153
- 2
- 12
1
vote
1 answer
How to setup OpenID to work with load balancer?
The stack I'm currently using is:
Keycloak
flask
flask-oidc
nginx as load balancer
The set up I'm having is I have two instances of a service running (instance1, instance2). The issue I'm facing is:
A user uses web browser to authenticate by going…

anhvutnu
- 105
- 1
- 1
- 6
1
vote
1 answer
not able to protect the python flask rest api service using keycloak
I have keycloak server running in docker (192.168.99.100:8080) and python flask-oidc flask application running locally ( localhost:5000) i am not able to access the protected Rest Api even after getting the access_token. has anyone tried this…

elliot alderson
- 53
- 1
- 9
0
votes
0 answers
How to access token from inside Flask decorator with flask_oidc
I am using flask_oidc to verify the access token sent from the client.
To check if the token is valid, I can use from flask_oidc:
@oidc.accept_token(require_token=True)
However, I also need to check the roles claim in the token. To accomplish this,…

linus
- 399
- 3
- 19
0
votes
1 answer
Python construct a mutable global object from another global object
I have main.py and app.py. app.py contains create_app() which returns the app object. main.py calls create_app(). I have to construct a mutable global object in main.py. This global object takes app as input parameter. This seems complex to me in…

Kok How Teh
- 3,298
- 6
- 47
- 85