Authentication Architecture¶
InfraLynx authentication is provider-based and centrally managed.
Goals¶
- support local, LDAP, OIDC, and SAML simultaneously
- keep provider-specific logic isolated from the rest of the platform
- preserve local admin fallback access
- enforce RBAC after identity resolution
- keep provider secrets encrypted at rest
Service Layout¶
@infralynx/auth-coreowns provider records, encrypted config storage, user mappings, session records, JWT issuance, refresh, logout, and auth logs@infralynx/auth-providers/localowns local username and password verification@infralynx/auth-providers/ldapowns LDAP connection testing, directory search, and credential verification@infralynx/auth-providers/oidcowns OIDC discovery, authorization redirect generation, and authorization-code callback completion@infralynx/auth-providers/samlowns SAML metadata parsing, redirect generation, and ACS response validationapps/api/src/authexposes the operational auth API and keeps the rest of the API boundary provider-agnostic
Persistence Model¶
The target relational model is:
auth_providerid,name,type,enabled,config,is_default,created_atuser_provider_mappinguser_id,provider_id,external_idauth_sessionid,user_id,provider_id,subject,tenant_id,role_ids,access_expires_at,refresh_expires_atauth_logid,level,action,actor_id,provider_id,session_id,message,created_at
The current bootstrap implementation persists the same shapes in encrypted file-backed state so the platform can run before the database-backed auth persistence slice lands.
Request Flow¶
- User opens login.
- UI loads enabled providers from
/api/auth/providers/enabled. - User either submits credentials or is redirected to OIDC or SAML.
- Auth API resolves provider-specific identity.
- Identity is mapped to an InfraLynx user or created through controlled mapping behavior.
- Session tokens are issued.
- Downstream APIs authorize actions using resolved role IDs.