diff --git a/src/ump/api/keycloak_utils.py b/src/ump/api/keycloak_utils.py index 07443c9..e1e222e 100644 --- a/src/ump/api/keycloak_utils.py +++ b/src/ump/api/keycloak_utils.py @@ -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) diff --git a/src/ump/main.py b/src/ump/main.py index a6a0e65..5a286de 100644 --- a/src/ump/main.py +++ b/src/ump/main.py @@ -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") @@ -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()