mirror of
https://github.com/StefBuwalda/ProjectIOT.git
synced 2025-10-30 19:29:57 +00:00
43 lines
1.1 KiB
Python
43 lines
1.1 KiB
Python
from flask import Flask
|
|
from flask_migrate import Migrate
|
|
from flask_sqlalchemy import SQLAlchemy
|
|
|
|
# from authlib.integrations.flask_client import OAuth
|
|
|
|
# Web Server
|
|
app = Flask(__name__)
|
|
app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///data.sqlite"
|
|
app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False
|
|
app.config["SECRET_KEY"] = "bvjchsygvduycgsyugc"
|
|
|
|
|
|
# ORM
|
|
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",
|
|
client_secret="IWKfsx2aLHCMr0iUaZOuws6UwiYrVQ60",
|
|
authorize_url=(f"{url}/realms/ProjectIOT/protocol/openid-connect/auth"),
|
|
authorize_params=None,
|
|
access_token_url=(
|
|
f"{url}/realms/ProjectIOT/protocol/openid-connect/token"
|
|
),
|
|
refresh_token_url=(
|
|
f"{url}/realms/ProjectIOT/protocol/openid-connect/token"
|
|
),
|
|
api_base_url=(f"{url}/realms/ProjectIOT/protocol/openid-connect"),
|
|
client_kwargs={"scope": "openid profile email"},
|
|
server_metadata_url=(
|
|
"{url}/realms/ProjectIOT/.well-known/openid-configuration"
|
|
),
|
|
)
|
|
"""
|