Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kgudel
Copy link
Contributor

@kgudel kgudel commented Jan 7, 2025

No description provided.

@@ -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)

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?

@@ -4,6 +4,16 @@ let keycloak = null
let isInitialized = false
let initPromise = null

const keycloakConfig = {
"realm": "hmda2",
"url": "https://{{domain}}}/auth",
Copy link
Contributor

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`,

Copy link
Contributor

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"
}```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants