3.9 KiB
3.9 KiB
Authority Module with OIDC/OAuth2, DPoP, mTLS
Module
Authority
Status
IMPLEMENTED
Description
Full Authority module with OIDC/OAuth2 flows, DPoP (Demonstration of Proof-of-Possession) handlers, mTLS support, and plugin-based identity provider architecture.
Implementation Details
- Modules:
src/Authority/StellaOps.Authority/StellaOps.Authority/OpenIddict/,src/Authority/StellaOps.Authority/StellaOps.Authority/Security/ - Key Classes:
ClientCredentialsHandlers(src/Authority/StellaOps.Authority/StellaOps.Authority/OpenIddict/Handlers/ClientCredentialsHandlers.cs) - client credentials grant with audit logging viaClientCredentialsAuditHelper.csPasswordGrantHandlers(src/Authority/StellaOps.Authority/StellaOps.Authority/OpenIddict/Handlers/PasswordGrantHandlers.cs) - resource owner password credentials grantRefreshTokenHandlers(src/Authority/StellaOps.Authority/StellaOps.Authority/OpenIddict/Handlers/RefreshTokenHandlers.cs) - refresh token rotation and validationDpopHandlers(src/Authority/StellaOps.Authority/StellaOps.Authority/OpenIddict/Handlers/DpopHandlers.cs) - DPoP proof-of-possession validation (RFC 9449)RevocationHandlers(src/Authority/StellaOps.Authority/StellaOps.Authority/OpenIddict/Handlers/RevocationHandlers.cs) - token revocation (RFC 7009)DiscoveryHandlers(src/Authority/StellaOps.Authority/StellaOps.Authority/OpenIddict/Handlers/DiscoveryHandlers.cs) - OpenID Connect discovery metadataTokenPersistenceHandlers(src/Authority/StellaOps.Authority/StellaOps.Authority/OpenIddict/Handlers/TokenPersistenceHandlers.cs) - persists issued tokens to storageTokenValidationHandlers(src/Authority/StellaOps.Authority/StellaOps.Authority/OpenIddict/Handlers/TokenValidationHandlers.cs) - validates token integrity and bindingAuthoritySenderConstraintHelper(src/Authority/StellaOps.Authority/StellaOps.Authority/OpenIddict/AuthoritySenderConstraintHelper.cs) - validates DPoP proof JWTs and sender-constrained tokensAuthorityClientCertificateValidator(src/Authority/StellaOps.Authority/StellaOps.Authority/Security/AuthorityClientCertificateValidator.cs) - validates client certificates for mTLS-bound tokensTokenRequestTamperInspector(src/Authority/StellaOps.Authority/StellaOps.Authority/OpenIddict/TokenRequestTamperInspector.cs) - detects tampered token requestsAuthorityTokenKinds(src/Authority/StellaOps.Authority/StellaOps.Authority/OpenIddict/AuthorityTokenKinds.cs) - enumerates supported token typesAuthoritySenderConstraintKinds(src/Authority/StellaOps.Authority/StellaOps.Authority/Security/AuthoritySenderConstraintKinds.cs) - constraint types (DPoP, mTLS)
- Interfaces:
IAuthorityClientCertificateValidator(src/Authority/StellaOps.Authority/StellaOps.Authority/Security/IAuthorityClientCertificateValidator.cs) - Source: Feature matrix scan
E2E Test Plan
- Request an access token via
ClientCredentialsHandlersand verify a valid JWT is returned with correct claims and scopes - Request an access token with a DPoP proof header and verify
DpopHandlersreturns a DPoP-bound token (token_type: DPoP) - Attempt to use a DPoP-bound token without the proof header and verify the request is rejected with 401
- Present a valid client certificate and request an mTLS-bound token; verify
AuthorityClientCertificateValidatorvalidates it and thecnfclaim contains the certificate thumbprint - Verify token refresh via
RefreshTokenHandlers: obtain a refresh token, exchange it for a new access token, and verify the old refresh token is rotated - Revoke a token via
RevocationHandlersand verify it is no longer accepted - Query the OpenID Connect discovery endpoint and verify
DiscoveryHandlersreturns DPoP and mTLS metadata - Submit a tampered token request and verify
TokenRequestTamperInspectorrejects it