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

MSI v1 token revocation specification #5137

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions docs/msiv1_token_revocation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# MSAL Support for MSI v1 Token Revocation and Capabilities

This specification describes **two optional parameters** that MSAL can send to the **MSI v1 endpoint** (e.g., `http://169.254.169.254/metadata/identity/oauth2/token`) when acquiring tokens via **Managed Identity**. These parameters empower developers to control **token revocation** and specify **client capabilities** that might alter the token issuance behavior by Azure AD (ESTS).

---

## Overview
Copy link
Member

Choose a reason for hiding this comment

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

Needs more details on the E2E, i.e. how does token revocation happen? i.e. what script do I run as a tenant admin?


When MSAL requests a token from the MSI v1 endpoint for resources like `https://management.azure.com/`, it typically reuses valid, locally cached tokens. However, certain scenarios require explicitly **ignoring** the cache or specifying **client capabilities** that Azure AD uses to enable or disable particular features.

To address these scenarios, two **optional** query parameters can be included in the MSI v1 token request:

1. **`bypass_cache`**
- Forces a token refresh if set to `true`.
2. **`xms_cc`**
- Declares special client capabilities that Azure AD should consider (e.g., for advanced or “undo revocation” scenarios).

---

## 1. `bypass_cache`
Copy link
Member

Choose a reason for hiding this comment

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

But this isn't signed off by Service Fabric? They want to know the exact token that needs to be invalidted.


### Purpose

Allows the developer to **get a brand-new token** from Azure AD. When `bypass_cache=true`, MSAL will ignore any valid, cached token and ensure the MSI v1 endpoint fetches a **new** token from Azure AD rather than returning a cached one.

### Behavior
- If set to `true`, MSAL will send `bypass_cache=true` to the MSI endpoint.
- If set to `false` or omitted, MSAL can return a cached token (if one exists and is still valid).

### Use Cases
- **Token Revocation**: Ensures any previously revoked or invalidated token is not served from cache.

---

## 2. `xms_cc`

### Purpose

Enables the developer to specify **client capabilities** in the token acquisition request. These capabilities are often used to unlock or disable specific features in Azure AD, such as handling specialized revocation scenarios.

### Behavior
- The value is typically a comma-separated list of capability strings.
- MSAL sends `xms_cc` to the MSI v1 endpoint, which then relays these capabilities to Azure AD as part of a JSON-encoded `claims` parameter.

### Use Cases
- **“Undo token revocation”** or other advanced features: By setting the required capabilities (`cp1`, etc.), MSAL can influence how Azure AD issues the token.

---
Loading