Skip to content

Commit

Permalink
Disable verification with keycloak
Browse files Browse the repository at this point in the history
  • Loading branch information
herzogrh committed Nov 13, 2024
1 parent e123777 commit 3bd39bd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/ump/api/keycloak_utils.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
"""Keycloak helper functions"""

import logging
from os import environ as env

from keycloak import KeycloakAdmin, KeycloakOpenIDConnection

keycloak_connection = KeycloakOpenIDConnection(
server_url=f"{env['KEYCLOAK_PROTOCOL']}://{env['KEYCLOAK_HOST']}/auth/",
server_url=f"{env['KEYCLOAK_PROTOCOL']}://{env['KEYCLOAK_HOST']}/",
username=env["KEYCLOAK_USER"],
password=env["KEYCLOAK_PASSWORD"],
realm_name="master",
user_realm_name="master",
client_id="admin-cli",
verify=True,
verify=False,
)

keycloak_admin = KeycloakAdmin(connection=keycloak_connection)
Expand Down
14 changes: 12 additions & 2 deletions src/ump/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,17 @@ def cleanup():
db = SQLAlchemy(app)
migrate = Migrate(app, db)

CORS(app, origins=["https://scenarioexplorer.comodeling.city", "http://localhost"], supports_credentials=True, allow_headers=["Content-Type", "Authorization"], methods=["GET", "POST", "PUT", "DELETE", "OPTIONS"])
CORS(
app,
origins=[
"https://scenarioexplorer.comodeling.city",
"http://localhost",
"https://auth.comodeling.city",
],
supports_credentials=True,
allow_headers=["Content-Type", "Authorization"],
methods=["GET", "POST", "PUT", "DELETE", "OPTIONS"],
)

api = APIBlueprint("api", __name__, url_prefix="/api")
api.register_blueprint(processes, url_prefix="/processes")
Expand All @@ -113,7 +123,7 @@ def cleanup():
server_url=f"{env['KEYCLOAK_PROTOCOL']}://{env['KEYCLOAK_HOST']}/",
client_id="ump-client",
realm_name="UrbanModelPlatform",
verify=True,
verify=False,
)
try:
config_well_known = keycloak_openid.well_known()
Expand Down

0 comments on commit 3bd39bd

Please sign in to comment.