Background
Implement P1 / PR 1 from #628 and docs/21-unified-identity-federation-design.md after the P0 authentication hardening work.
The current OAuth/OIDC login path is centered on OAuthClaims, while account-state checks and PlatformPrincipal construction are duplicated across external and local login. Provider codes are also not pinned to a stable identity authority.
Scope
- Add the unified identity core value model:
ProviderAuthenticationResult
- core-owned
IdentityAssertionFactory / IdentityAssertion
ProviderReference, typed ExternalSubject
EmailAssurance, AuthenticationEvidence
IdentityLoginOutcome
- Add trusted provider route/descriptor resolution for the existing GitHub, GitLab, and OIDC client registrations.
- Add
ProviderAuthorityLockService and the additive identity_provider_state Flyway migration.
- Enforce database compare-and-set authority pinning, sticky mismatch, and same-authority explicit recovery.
- Filter
AuthMethodCatalog through the trusted descriptor and persisted authority state.
- Add shared
AccountLoginGuard and PlatformPrincipalFactory.
- Migrate GitHub/GitLab/OIDC login to
ExternalIdentityLoginService.
- Reuse the shared guard and principal factory from local password login.
- Keep the current
identity_binding table and existing provisioning behavior for compatibility.
- Keep session creation outside the identity transaction and only accept
Authenticated outcomes.
Explicitly out of scope
- LDAP, DingTalk, CAS, SAML, SCIM, trusted-header adapters
- Binding V2 / persisted typed subject aliases
- Dynamic provider registry or runtime plugins
- Full profile sync and provisioning policy redesign
PlatformPrincipal schema changes
Security invariants
- Provider code, protocol, authority, subject rules, and attribute mappings come only from a trusted server-side descriptor.
- Adapter results cannot select a platform account, role, provider code, authority, or session.
- Authority fingerprint is
lowercaseHex(SHA-256(UTF-8(protocol + "\\n" + canonicalAuthority))).
- Authority mismatch fails closed and remains sticky until explicit same-fingerprint recovery or a future audited migration.
- Primary subject is required, typed, bounded, and descriptor-allowed.
- Non-empty aliases fail closed until Binding V2.
PENDING, DISABLED, MERGED, and system accounts cannot establish an interactive session.
- Tokens, tickets, cookies, credentials, and raw upstream responses never enter the assertion or ordinary audit data.
Acceptance criteria
Integration policy
Develop and validate on big-main first. Do not merge directly to main; create a clean-main PR only after prerequisite P0/design commits are present on main and origin/main..HEAD contains only this issue's commits.
Background
Implement P1 / PR 1 from #628 and
docs/21-unified-identity-federation-design.mdafter the P0 authentication hardening work.The current OAuth/OIDC login path is centered on
OAuthClaims, while account-state checks andPlatformPrincipalconstruction are duplicated across external and local login. Provider codes are also not pinned to a stable identity authority.Scope
ProviderAuthenticationResultIdentityAssertionFactory/IdentityAssertionProviderReference, typedExternalSubjectEmailAssurance,AuthenticationEvidenceIdentityLoginOutcomeProviderAuthorityLockServiceand the additiveidentity_provider_stateFlyway migration.AuthMethodCatalogthrough the trusted descriptor and persisted authority state.AccountLoginGuardandPlatformPrincipalFactory.ExternalIdentityLoginService.identity_bindingtable and existing provisioning behavior for compatibility.Authenticatedoutcomes.Explicitly out of scope
PlatformPrincipalschema changesSecurity invariants
lowercaseHex(SHA-256(UTF-8(protocol + "\\n" + canonicalAuthority))).PENDING,DISABLED,MERGED, and system accounts cannot establish an interactive session.Acceptance criteria
IdentityLoginOutcome.AuthenticatedreachesPlatformSessionService.Integration policy
Develop and validate on
big-mainfirst. Do not merge directly tomain; create a clean-main PR only after prerequisite P0/design commits are present onmainandorigin/main..HEADcontains only this issue's commits.