Skip to content

Commit d88df71

Browse files
4gustrayluo
andauthored
Update msiv1_token_revocation.md (#5222)
* Update msiv1_token_revocation.md * Update token revocation documentation with detailed steps * Update msiv1_token_revocation.md * Update msiv1_token_revocation.md * Update msiv1_token_revocation.md * Update docs/msiv1_token_revocation.md Co-authored-by: Ray Luo <[email protected]> * Update docs/msiv1_token_revocation.md Co-authored-by: Ray Luo <[email protected]> --------- Co-authored-by: Ray Luo <[email protected]>
1 parent 83acad1 commit d88df71

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

docs/msiv1_token_revocation.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,23 @@ Steps 1-4 fall to the Client (i.e. application using MSI directly or higher leve
3939
Steps 5-9 are new and show how the RP propagates the revocation signal.
4040

4141
### Explanation:
42-
1. The client (CX) calls some **Resource** with token **T**.
43-
2. The resource detects **T** is bad (revoked) and returns **401** + **claims C**.
44-
3. CX parses **C** and calls **MSAL** with `.WithClaims(C).WithClientCapabilities(cp1)`.
45-
4. MSAL sees the local cached token is "bad" → triggers a refresh flow.
46-
5. MSAL calls **MITS** with `xms_cc=cp1&token_sha256_to_refresh=SHA256(T)`.
47-
6. **MITS** is basically a proxy, forwarding the query to **SFRP**.
48-
7. **SFRP** uses MSAL again to get a **new** token from eSTS.
42+
1. CX creates an **MSAL Client** with `.WithClientCapabilities(cp1)`, to let the token issuer know that it is capable of handling token revocations.
43+
2. The client (CX) calls some **Resource** with token **T**.
44+
3. The resource detects **T** is bad (revoked) and returns **401** + **claims C**.
45+
4. CX parses the WWW-Authenticate header, extracts the claims **C** and uses MSAL **AcquireToken** with `.WithClaims(C)`.
46+
5. MSAL inspects its cache first. If it finds a token, the token is considered to have been revoked. MSAL needs to tell the token issuer about it, so that the token issuer can also bypass its own cache.
47+
6. MSAL calls **MITS** with `xms_cc=cp1&token_sha256_to_refresh=SHA256(T)`.
48+
7. **MITS** uses the information to bypass its own caches and to get a new token from its upstream **SFRP**.
49+
8. **SFRP** uses MSAL again to get a **new** token from eSTS.
4950

5051
> [!IMPORTANT]
5152
> This design is only applicable to MIRP api-version=2025-03-30 (for App Service). api-version for service fabric will be soon made available.
5253
54+
> [!NOTE]
55+
> The SHA256 conversion is done by doing a Hex-encoded SHA-256 hash of the token (UTF-8). For example: BitConverter.ToString(SHA256(Encoding.UTF8.GetBytes(accessToken))).
56+
> Example - "test_token" -> "cc0af97287543b65da2c7e1476426021826cab166f1e063ed012b855ff819656"
57+
58+
5359
> [!NOTE]
5460
> ClientCapabilities is an array of capabilities. In case the app developer sends multiple capabilities, these will be sent to the RP as `MITS_endpoint?xms_cc=cp1,cp2,cp3`. The RP MUST pass "cp1" (i.e. the CAE capabilitiy) if it is included.
5561

0 commit comments

Comments
 (0)