Skip to content

Instantly share code, notes, and snippets.

@asyd
asyd / app.py
Created October 4, 2024 12:03
flask_dance keycloak usage example
# Since redirect_url is not in https, ensure you set OAUTHLIB_INSECURE_TRANSPORT environment varaible
from flask import Flask, jsonify, request, redirect, url_for
from flask_dance.consumer import OAuth2ConsumerBlueprint
app = Flask(__name__)
app.secret_key = 'xxx'
keycloak = OAuth2ConsumerBlueprint(
name="keycloak",