-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proof of concept showing the frontend using keycloak on an arbitrary domain #2385
base: master
Are you sure you want to change the base?
Conversation
@@ -28,12 +38,12 @@ export const initKeycloak = (overrides) => { | |||
} else if (import.meta.env.MODE === 'development') { | |||
keycloak = new Keycloak('/local_keycloak.json') | |||
} else { | |||
keycloak = new Keycloak('/keycloak.json') | |||
keycloak = new Keycloak(keycloakConfig) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be any easier to manage/revert the keycloak config as a ConfigMap?
src/common/api/Keycloak.js
Outdated
@@ -4,6 +4,16 @@ let keycloak = null | |||
let isInitialized = false | |||
let initPromise = null | |||
|
|||
const keycloakConfig = { | |||
"realm": "hmda2", | |||
"url": "https://{{domain}}}/auth", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you try replacing line 9 with the following to make it dynamic?
"url": `https://${window.location.hostname}/auth`,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To account for local testing, please use the following:
let keycloakRedirect = null
if (hostname == 'localhost') {
keycloakRedirect = 'ffiec.cfpb.gov'
} else {
keycloakRedirect = hostname
}
const keycloakConfig = {
"realm": "hmda2",
"url": `https://${keycloakRedirect}/auth`,
"clientId": "hmda2-api",
"public-client": true,
"use-resource-role-mappings": true,
"confidential-port": 0,
"ssl-required": "all"
}```
No description provided.