Skip to content

MTLS Without Tokens Support - DownstreamApi - #3747

Merged
Gladwin Johnson VR (gladjohn) merged 24 commits into
AzureAD:masterfrom
tlupes:mTLS
Apr 17, 2026
Merged

Gladwin Johnson VR (gladjohn) merged 24 commits into
AzureAD:masterfrom
tlupes:mTLS

Conversation

@tlupes

@tlupes Tom (tlupes) commented Mar 11, 2026 •

Copy link
Copy Markdown
Collaborator

Support for mTLS authentication only mode for DownstreamApi

Adds support for mTLS only mode for DownstreamApi. This allows you to configure a protocol of "MTLS" and the configured certificate will be attached to the request without and authentication header.

This is set up to work with all existing certificate infrastructure as Token Acquisition. This means that the Managed Certificate logic will fit right in.

Description

This essentially does the following:

  • Refactors all the certificate handling logic (including the observers) into a reusable "CredentialProvider"
  • Modifies TokenAquesition to use this CredentialProvider
  • Configures DownstreamApi to use this CredentialProvider as well.
    • If Protocol is MTLS, tokens are skipped
    • If Protocol is MTLS, it takes the first certificate credential and adds it as a certificate.
    • If Protocol is MTLS, the result of the call is checked right there to see if it's a certificate error. If so, it retries once.

@tlupes
Tom (tlupes) marked this pull request as ready for review March 17, 2026 20:54
@tlupes
Tom (tlupes) requested a review from a team as a code owner March 17, 2026 20:54

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also add sample app (see tests/DevApps/MtlsPop as an example) which shows a developer experience?

Comment thread src/Microsoft.Identity.Web.TokenAcquisition/CredentialsProvider.cs Outdated
Comment thread src/Microsoft.Identity.Web.DownstreamApi/DownstreamApi.cs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks!

Comment thread src/Microsoft.Identity.Web.DownstreamApi/DownstreamApi.cs Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants