Skip to content

Commit

Permalink
add HHSAMS config to vite env files
Browse files Browse the repository at this point in the history
Signed-off-by: John DeAngelis <[email protected]>
  • Loading branch information
johndeange committed Oct 8, 2024
1 parent 73bf406 commit 38775b1
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 7 deletions.
3 changes: 2 additions & 1 deletion frontend/Dockerfile.azure
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ COPY . .
# Build the application
ARG MODE
ARG VITE_BACKEND_DOMAIN
COPY vite-env/env.${MODE}.local .env
COPY vite-env/env.local .
COPY vite-env/env.${MODE}.local .
RUN VITE_BACKEND_DOMAIN=${VITE_BACKEND_DOMAIN} NODE_ENV=${MODE} bun run build --mode ${MODE}

# ---- Release Stage ----
Expand Down
10 changes: 7 additions & 3 deletions frontend/src/helpers/backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,17 @@ export const callBackend = async (urlPath, action, requestBody, queryParams, use

export const authConfig = {
hhsams: {
auth_endpoint: "https://sso-stage.acf.hhs.gov/auth/realms/ACF-SSO/protocol/openid-connect/auth",
client_id: "44fe2c7a-e9c5-43ec-87e9-3de78d2d3a11",
auth_endpoint:
import.meta.env.VITE_HHSAMS_AUTH_ENDPOINT ||
"https://sso-stage.acf.hhs.gov/auth/realms/ACF-SSO/protocol/openid-connect/auth",
client_id: import.meta.env.VITE_HHSAMS_CLIENT_ID || "44fe2c7a-e9c5-43ec-87e9-3de78d2d3a11",
response_type: "code",
scope: "openid profile email",
redirect_uri: `${window.location.origin}/login`,
acr_values: 1,
logout_endpoint: "https://sso-stage.acf.hhs.gov/auth/realms/ACF-SSO/protocol/openid-connect/logout"
logout_endpoint:
import.meta.env.VITE_HHSAMS_LOGOUT_ENDPOINT ||
"https://sso-stage.acf.hhs.gov/auth/realms/ACF-SSO/protocol/openid-connect/logout"
},
logingov: {
auth_endpoint: "https://idp.int.identitysandbox.gov/openid_connect/authorize",
Expand Down
4 changes: 3 additions & 1 deletion frontend/vite-env/env.dev.local
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
VITE_ENV_VAR_EXAMPLE=dev-example
VITE_HHSAMS_CLIENT_ID=44fe2c7a-e9c5-43ec-87e9-3de78d2d3a11
VITE_HHSAMS_AUTH_ENDPOINT=https://sso-stage.acf.hhs.gov/auth/realms/ACF-SSO/protocol/openid-connect/auth
VITE_HHSAMS_LOGOUT_ENDPOINT=https://sso-stage.acf.hhs.gov/auth/realms/ACF-SSO/protocol/openid-connect/logout
3 changes: 3 additions & 0 deletions frontend/vite-env/env.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
VITE_HHSAMS_CLIENT_ID=44fe2c7a-e9c5-43ec-87e9-3de78d2d3a11
VITE_HHSAMS_AUTH_ENDPOINT=https://sso-stage.acf.hhs.gov/auth/realms/ACF-SSO/protocol/openid-connect/auth
VITE_HHSAMS_LOGOUT_ENDPOINT=https://sso-stage.acf.hhs.gov/auth/realms/ACF-SSO/protocol/openid-connect/logout
4 changes: 3 additions & 1 deletion frontend/vite-env/env.production.local
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
VITE_ENV_VAR_EXAMPLE=prod-example
VITE_HHSAMS_CLIENT_ID=44fe2c7a-e9c5-43ec-87e9-3de78d2d3a11
VITE_HHSAMS_AUTH_ENDPOINT=https://sso-stage.acf.hhs.gov/auth/realms/ACF-SSO/protocol/openid-connect/auth
VITE_HHSAMS_LOGOUT_ENDPOINT=https://sso-stage.acf.hhs.gov/auth/realms/ACF-SSO/protocol/openid-connect/logout
4 changes: 3 additions & 1 deletion frontend/vite-env/env.stg.local
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
VITE_ENV_VAR_EXAMPLE=stg-example
VITE_HHSAMS_CLIENT_ID=44fe2c7a-e9c5-43ec-87e9-3de78d2d3a11
VITE_HHSAMS_AUTH_ENDPOINT=https://sso-stage.acf.hhs.gov/auth/realms/ACF-SSO/protocol/openid-connect/auth
VITE_HHSAMS_LOGOUT_ENDPOINT=https://sso-stage.acf.hhs.gov/auth/realms/ACF-SSO/protocol/openid-connect/logout

0 comments on commit 38775b1

Please sign in to comment.