Skip to content

fix: prevent CDA GUI auth bootstrap crash - #1865

Merged
MikeNeilson merged 2 commits into
developfrom
fix/cda-gui-auth-bootstrap
Aug 7, 2026
Merged

fix: prevent CDA GUI auth bootstrap crash#1865
MikeNeilson merged 2 commits into
developfrom
fix/cda-gui-auth-bootstrap

Conversation

@krowvin

@krowvin krowvin commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Load deployed Keycloak settings at runtime from the OpenAPI document instead of eagerly reading build-time Vite variables.
  • Keep the CDA GUI available when OpenID configuration is missing or invalid, and show a controlled sign-in-unavailable state.
  • Add a true application-level React error boundary and correct the React Router error fallback to use useRouteError().
  • Share OpenID/Keycloak parsing between the application auth provider and Swagger UI, with focused regression tests.

Related Issue

Follow-up to #1734.

The user-list UI introduced an app-wide createKeycloakAuthMethod() call during main.jsx module evaluation. The deployable production-mode bundle does not define VITE_AUTH_HOST, so Groundwork received host: undefined and failed on host.trim() before React or the router error boundary could render. This left the CWBI dev UI on a white error page.

User Impact

CDA now derives authentication configuration from the deployment's own OpenAPI document. If the deployment does not advertise usable OpenID configuration, public CDA pages remain available and authenticated features explain that sign-in is unavailable instead of crashing the entire application.

Validation

  • npm run test — 4 tests passed
  • npm run lint
  • npm run build using Vite production mode
  • Repeated test, lint, and production build in an isolated npm ci --ignore-scripts installation using the locked Groundwork 3.9.0 dependency
  • Loaded the production artifact locally in a browser with unavailable OpenID configuration; verified the CDA introduction page rendered, the sign-in-unavailable state appeared, the page was not blank, and the console had no errors

Checklist

  • AI tools used

@krowvin
krowvin requested a review from MikeNeilson August 6, 2026 16:17
@krowvin
krowvin marked this pull request as ready for review August 6, 2026 16:17
Comment thread cda-gui/src/main.jsx
MikeNeilson
MikeNeilson previously approved these changes Aug 6, 2026
Comment thread cda-gui/src/components/AppAuthProvider.jsx
@krowvin

krowvin commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator Author

I attempted to close and re-open this to retrigger the github actions that were stuck.

Ended up sorting an import in a file to retrigger the actions (committed)

@MikeNeilson

Copy link
Copy Markdown
Contributor

I attempted to close and re-open this to retrigger the github actions that were stuck.

Ended up sorting an import in a file to retrigger the actions (committed)

In the future don't do that, we can manually trigger rerunning of failed actions.

@krowvin

krowvin commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator Author

in future don't do that, we can manually trigger rerunning of failed actions.

I typically wouldn't but was hoping to get around the GitHub actions issues and thought i'd try it.

The manual retrigger was not working (due to the outage)

krowvin added 2 commits August 7, 2026 06:55
Signed-off-by: Charles Graham, SWT <charles.r.graham@usace.army.mil>
@MikeNeilson
MikeNeilson force-pushed the fix/cda-gui-auth-bootstrap branch from 7c485b5 to 0221dc1 Compare August 7, 2026 13:55
@MikeNeilson
MikeNeilson merged commit 5183dfe into develop Aug 7, 2026
10 of 11 checks passed
@MikeNeilson
MikeNeilson deleted the fix/cda-gui-auth-bootstrap branch August 7, 2026 14:42
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.

2 participants