forge-docs

0003. Authentication and User Management Approach

Status: Accepted Date: 2025-10-08 Context: Continuation of ADR-0002 (Quarkus adoption); defines authentication, authorization, and user data management.

Context

The platform requires secure, standards-based authentication and user management for both web and API clients. Key requirements include:

Two primary models were considered:

  1. Application-managed identity using Quarkus Security JPA, storing credentials and roles in our own database.
  2. Delegated identity management using a managed OIDC provider, specifically AWS Cognito.

Decision

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.


Rationale

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.


Implementation Outline

In Quarkus

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

Persistence Layer

Local Development


Future Alternatives

If business needs require:


Consequences

Positive

Negative / Trade-offs