Skip to content

Commit

Permalink
Added logic for different keycloak auth paths (#567)
Browse files Browse the repository at this point in the history
* Added logic for different keycloak auth paths

* Modified code with suggestions

* Fixed linting issues
  • Loading branch information
wcater803 authored and mshriver committed Feb 26, 2025
1 parent acc02ca commit ea2e526
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repos:
- id: debug-statements

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.2
rev: v0.9.6
hooks:
- id: ruff
args:
Expand Down
2 changes: 1 addition & 1 deletion backend/ibutsu_server/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
"params": [
{
"name": "filters",
"description": "The filters for the runs to be included" " in the query.",
"description": "The filters for the runs to be included in the query.",
"type": "string",
"required": True,
},
Expand Down
3 changes: 2 additions & 1 deletion backend/ibutsu_server/util/keycloak.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ def get_keycloak_config(is_private=False):
"authorization_url": build_url(realm_base_url, "protocol/openid-connect/auth"),
"realm": realm,
"client_id": current_app.config.get("KEYCLOAK_CLIENT_ID"),
"redirect_uri": backend_url + "/login/auth/keycloak",
"redirect_uri": backend_url
+ current_app.config.get("KEYCLOAK_AUTH_PATH", "/login/auth/keycloak"),
}
if current_app.config.get("KEYCLOAK_ICON"):
config["icon"] = current_app.config["KEYCLOAK_ICON"]
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/services/keycloak.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ export class KeycloakService {
static login (url, realm, client_id) {
const keycloakInstance = new Keycloak({url: url, realm: realm, clientId: client_id});
keycloakInstance.init({onLoad: 'login-required', checkLoginIframe: false, responseMode: 'query',
redirectUri: Settings.serverUrl + '/login/auth/keycloak'});
redirectUri: Settings.serverUrl + (Settings.keycloakAuthPath || '/login/auth/keycloak') });
}
}

0 comments on commit ea2e526

Please sign in to comment.