Status: Accepted Date: 2025-10-08 Context: Continuation of ADR-0002 (Quarkus adoption); defines authentication, authorization, and user data management.
The platform requires secure, standards-based authentication and user management for both web and API clients. Key requirements include:
Two primary models were considered:
We will adopt AWS Cognito as the primary authentication and user-management service.
Quarkus will integrate via the quarkus-oidc extension, treating Cognito as an external OpenID Connect provider.
| Consideration | Cognito (Chosen) | Quarkus Security JPA (Not Chosen for now) |
|---|---|---|
| Operations | Fully managed service, handles signup, password reset, MFA, social login | Requires us to store and hash passwords, build account flows |
| Security posture | Offloads credential handling and compliance to AWS | Higher risk surface; must implement secure storage and policies ourselves |
| Scalability | Auto-scales with user base; integrates with AWS IAM | Scales with our Aurora DB; more tuning required |
| Integration | Works natively with Quarkus OIDC and ALB OIDC auth | Tight coupling to DB schema; limited federation options |
| Future flexibility | Supports enterprise federation (SAML, OIDC, AD) | Limited to in-app users unless refactored later |
Given limited operational capacity at this stage, Cognito provides a secure, standards-compliant baseline while allowing later customization if business needs demand internal user management.
quarkus.oidc.auth-server-url=https://cognito-idp.<region>.amazonaws.com/<user-pool-id>
quarkus.oidc.client-id=<client-id>
quarkus.oidc.credentials.secret=<client-secret>
quarkus.oidc.application-type=web-app
quarkus.oidc.authentication.scopes=openid,profile,email
@RolesAllowed and SecurityIdentity.sub UUID, profile metadata) stored as foreign keys — no passwords.quarkus.oidc.devservices.enabled=true can spin up a local OIDC provider automatically when needed for unit testing.If business needs require:
Positive
Negative / Trade-offs