Story 1.3: Keycloak Realm Configuration & OIDC Integration
Status: ready-for-dev
Story
As a any team member,
I want to authenticate using Keycloak single sign-on via OpenID Connect,
so that I can securely access the application with my organizational credentials.
Acceptance Criteria
- Given a user navigates to the application while unauthenticated When they load any protected route Then they are redirected to the Keycloak login page for the configured realm
- Given a user enters valid Keycloak credentials When authentication succeeds Then they receive a JWT access token, are redirected to their role-specific workspace, and the authentication event is logged to the audit service within 5 seconds (NFR7)
- Given a user's access token expires When they make an authenticated request Then the refresh token flow silently renews the session or redirects to login if the refresh token is also expired
- Given an invalid or expired token is presented to the API When the request is processed Then the API returns 401 Unauthorized and the failed authentication attempt is captured in the audit log
- Given the application is deployed When traffic is inspected Then all communication is over TLS 1.2+ (NFR4) and sensitive token data is not exposed in URLs or logs
Tasks / Subtasks
Dev Notes
- Follow Epic 1 architecture constraints: ASP.NET Core + React separation, RBAC-aware patterns, and immutable legacy tables.
- Reuse shared component and workflow patterns defined in UX and architecture docs; avoid parallel custom implementations.
- Keep changes scoped to this story; do not pull forward Epic 2+ features.
Project Structure Notes
- Backend:
BriansClientRouteReports.Server/
- Frontend:
brians-client-route-reports-client/
- Story artifacts:
_bmad-output/implementation-artifacts/
References
- Story source:
_bmad-output/planning-artifacts/epics.md (Epic 1 / Story 1.3)
- Architecture constraints:
_bmad-output/planning-artifacts/architecture.md
- UX patterns:
_bmad-output/planning-artifacts/ux-design-specification.md
Dev Agent Record
Agent Model Used
GPT-5 Codex
Debug Log References
- Story generated from epic source and architecture/UX planning artifacts.
Completion Notes List
- Story context created and marked ready-for-dev.
File List
_bmad-output/implementation-artifacts/1-3-keycloak-realm-configuration-oidc-integration.md