Skip to content

MTLS Without Tokens Support - DownstreamApi#3747

Merged
gladjohn merged 24 commits into
AzureAD:masterfrom
tlupes:mTLS
Apr 17, 2026
Merged

MTLS Without Tokens Support - DownstreamApi#3747
gladjohn merged 24 commits into
AzureAD:masterfrom
tlupes:mTLS

Conversation

@tlupes
Copy link
Copy Markdown
Collaborator

@tlupes tlupes commented Mar 11, 2026

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 tlupes marked this pull request as ready for review March 17, 2026 20:54
@tlupes tlupes requested a review from a team as a code owner March 17, 2026 20:54
Copy link
Copy Markdown
Contributor

@cpp11nullptr cpp11nullptr left a comment

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.TokenAcquisition/CredentialsProvider.cs
Comment thread src/Microsoft.Identity.Web.DownstreamApi/DownstreamApi.cs Outdated
Copy link
Copy Markdown
Contributor

@neha-bhargava neha-bhargava left a comment

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
@bgavrilMS bgavrilMS requested a review from gladjohn March 26, 2026 12:53
Comment thread src/Microsoft.Identity.Web.DownstreamApi/DownstreamApi.cs
This was referenced May 24, 2026
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