Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Design Document: Mutual TLS (mTLS) Proof-of-Possession (PoP) Tokens Implementation #5087

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

gladjohn
Copy link
Contributor

Mutual TLS (mTLS) Proof-of-Possession (PoP) Tokens Design Document

This pull request introduces a comprehensive design document for the implementation of mutual TLS (mTLS) Proof-of-Possession (PoP) tokens using Subject Name Issuer (SNI) certificates. The document outlines the security benefits, token flow, implementation details, and testing strategies for this feature.

Key Changes

Design and Implementation Details

  • Added an overview of mTLS PoP tokens and their compliance with RFC 8705, including a diagram outlining the mTLS PoP flow.
  • Detailed the certificate acquisition and token binding processes, explaining how tokens are bound to certificates used in mTLS connections.
  • Introduced the new WithMtlsProofOfPossession() API at the CCA request level, specifying the required configurations and validations for certificates, authority types, and Azure regions.

Testing and Validation

  • Provided a comprehensive list of tests to validate mTLS PoP tokens, including:
    • Certificate validation
    • Authority tests
    • Region validation
    • Token acquisition
    • Integration tests

Developer Guidance and Task List

  • Included detailed developer guidance for implementing the WithMtlsProofOfPossession() feature.
  • Created a task list for the public preview of SDK support for mTLS PoP tokens across different programming languages, including:
    • MSAL .NET
    • JAVA
    • NODE
    • PYTHON

By highlighting that the design is based on the MSAL .NET implementation, this description provides context for reviewers and collaborators, indicating that the document leverages existing work and insights from the .NET version of the Microsoft Authentication Library.

Reference Documentation

For more detailed information on Proof-of-Possession (PoP) tokens implementation in MSAL .NET, you can refer to the MSAL .NET Pull Request:

Proof-of-Possession (PoP) tokens in MSAL .NET

@gladjohn gladjohn requested a review from a team as a code owner January 16, 2025 19:37
@@ -0,0 +1,192 @@
# Overview

Bearer tokens are vulnerable to theft. Proof-of-Possession (PoP) tokens mitigate this by binding tokens to a specific client certificate. mTLS PoP tokens enhance this security by using mutual TLS (mTLS) to ensure the token is tied to the certificate used for authentication.
Copy link
Member

Choose a reason for hiding this comment

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

When you say "the token is tied to the certificate used for authentication" Are you saying that the SNI cert to authenticate the app is also used to init the HTTP MTLS connection? Are you not able to use 2 different certs here?


##### Authority URL Validation

- Avoid using `/common` in the authority URL. Use a tenanted authority instead.
Copy link
Member

Choose a reason for hiding this comment

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

Should this also fail if using /consumers or /organizations?

Copy link
Member

Choose a reason for hiding this comment

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

+1. Maybe not \consumers as that's an actual tenant. But yes to /organizations

@trwalke
Copy link
Member

trwalke commented Jan 17, 2025

Maybe you can add an example code snippet of what the app creation and token acquisition apis look like?

@trwalke
Copy link
Member

trwalke commented Jan 17, 2025

I would maybe add a few more details to the image. Like, what is sent to ESTS to initialize this flow and acquire the token initially. What does ESTS return (what is special about the token). Things like that.

Copy link
Member

@trwalke trwalke left a comment

Choose a reason for hiding this comment

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

Overall looks great @gladjohn


## Task List

### [EPIC 3127989](https://identitydivision.visualstudio.com/Engineering/_workitems/edit/3127989) - Public Preview - SDK support for MTLS-POP tokens for SN/I certificates
Copy link
Member

Choose a reason for hiding this comment

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

Add a link to the MISE doc

- Flow is applicable only to AAD and DSTS authorities.
- Unsupported authority types (e.g., B2C) will result in `MsalClientException` with the error `MsalError.InvalidAuthorityType`.

##### Authority URL Validation
Copy link
Member

Choose a reason for hiding this comment

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

This paragraph is duplicate in the acceptance tests below.


##### Authority Type Validation

- Flow is applicable only to AAD and DSTS authorities.
Copy link
Member

Choose a reason for hiding this comment

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

Needs a paragraph around the endpoint used.

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.

4 participants