Skip to content

Commit

Permalink
add logic to decide the keycloak hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
kgudel committed Jan 14, 2025
1 parent acfa862 commit 7729f5c
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/common/api/Keycloak.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,22 @@ let keycloak = null
let isInitialized = false
let initPromise = null

let keycloakRedirect = null
let hostname = window.location.hostname

if (hostname == 'ffiec.beta.cfpb.gov') {
keycloakRedirect = 'ffiec.cfpb.gov'
} else if (hostname.includes('4-beta')) {
keycloakRedirect = hostname.replace('4-beta.demo', 'dev')
} else if (hostname.includes('-beta')) {
keycloakRedirect = hostname.replace('-beta', '')
} else {
keycloakRedirect = hostname
}

const keycloakConfig = {
"realm": "hmda2",
"url": "https://{{domain}}}/auth",
"url": `https://${keycloakRedirect}/auth`,
"clientId": "hmda2-api",
"public-client": true,
"use-resource-role-mappings": true,
Expand Down

0 comments on commit 7729f5c

Please sign in to comment.