mirror of
https://github.com/StefBuwalda/ProjectIOT.git
synced 2025-10-29 18:59:57 +00:00
Commented out keycloak
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
from flask import Flask
|
||||
from flask_migrate import Migrate
|
||||
from flask_sqlalchemy import SQLAlchemy
|
||||
from authlib.integrations.flask_client import OAuth
|
||||
|
||||
# from authlib.integrations.flask_client import OAuth
|
||||
|
||||
# Web Server
|
||||
app = Flask(__name__)
|
||||
@@ -16,8 +17,10 @@ db = SQLAlchemy(app)
|
||||
migrate = Migrate(app, db)
|
||||
|
||||
# Keycloak
|
||||
"""
|
||||
oauth = OAuth(app=app)
|
||||
url = "http://192.168.69.1:8180"
|
||||
|
||||
keycloak: ... = oauth.register(
|
||||
name="keycloak",
|
||||
client_id="ProjectIOT",
|
||||
@@ -36,3 +39,4 @@ keycloak: ... = oauth.register(
|
||||
"{url}/realms/ProjectIOT/.well-known/openid-configuration"
|
||||
),
|
||||
)
|
||||
"""
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
from flask import Blueprint, session, redirect, url_for, render_template
|
||||
from application import keycloak
|
||||
|
||||
# from application import keycloak
|
||||
|
||||
auth_blueprint = Blueprint("auth", __name__, template_folder="templates")
|
||||
|
||||
@@ -17,14 +18,17 @@ def home():
|
||||
return redirect(url_for("auth.login"))
|
||||
|
||||
|
||||
"""
|
||||
@auth_blueprint.route("/login")
|
||||
def login():
|
||||
redirect_uri = url_for("auth.auth", _external=True)
|
||||
return keycloak.authorize_redirect(redirect_uri)
|
||||
"""
|
||||
|
||||
|
||||
"""
|
||||
@auth_blueprint.route("/auth")
|
||||
def auth():
|
||||
user = keycloak.userinfo()
|
||||
session["user"] = user
|
||||
return redirect(url_for("auth.home"))
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user