Skip to content

[Engineering task] Add mTLS PoP support for WithCertificate(() => x509) (DynamicCertificateClientCredential) #5943

@gladjohn

Description

@gladjohn

Task type

Development

Description

Currently MtlsPopParametersInitializer.InitExplicitMtlsPopAsync handles:

  1. CertificateClientCredential — uses static Certificate property
  2. IClientSignedAssertionProvider — calls GetAssertionAsync for the cert
  3. Everything else — throws

DynamicCertificateClientCredential (backing WithCertificate(() => x509)) matches none of these cases, so .WithMtlsProofOfPossession() throws at preflight.

Solution

Fix: Add a case in InitExplicitMtlsPopAsync for CertificateAndClaimsClientCredential (the base class) — call its provider to resolve the cert, then pass it to InitMtlsPopParameters. Same for TryInitImplicitBearerOverMtlsAsync.

The credential material path already handles mTLS mode correctly (returns empty params + cert). Only the preflight needs wiring.

Scope: MtlsPopParametersInitializer.cs + tests. Feature branch recommended.

Metadata

Metadata

Assignees

Type

Projects

Status

No status

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions