You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -50,7 +50,7 @@ Unlike msal-dotnet, which receives this DLL automatically via NuGet, Java applic
50
50
51
51
Before using this extension, ensure Managed Identity is enabled on your Azure VM.
52
52
53
-
### Acquiring an mTLS PoP Token
53
+
### Path 2 — Managed Identity: Acquiring an mTLS PoP Token
54
54
55
55
Acquiring a token follows this general pattern:
56
56
@@ -63,7 +63,7 @@ Acquiring a token follows this general pattern:
63
63
64
64
MtlsMsiClient client =newMtlsMsiClient();
65
65
MtlsMsiHelperResult result = client.acquireToken(
66
-
"https://management.azure.com", // resource
66
+
"https://graph.microsoft.com", // resource (confirmed enrolled for mTLS PoP)
67
67
"SystemAssigned", // identity type
68
68
null, // identity id (null for system-assigned)
69
69
false, // withAttestation — set true on Trusted Launch VMs
@@ -76,7 +76,7 @@ Acquiring a token follows this general pattern:
76
76
77
77
```java
78
78
MtlsMsiHelperResult result = client.acquireToken(
79
-
"https://management.azure.com",
79
+
"https://graph.microsoft.com",
80
80
"UserAssigned",
81
81
"your-client-id",
82
82
false,
@@ -85,9 +85,11 @@ Acquiring a token follows this general pattern:
85
85
String accessToken = result.getAccessToken();
86
86
```
87
87
88
+
>**Resource note:**Use `https://graph.microsoft.com` or `https://storage.azure.com`. `https://management.azure.com` may return `AADSTS392196` if that resource is not enrolled for mTLS PoP in your tenant.
89
+
88
90
2.The binding certificate is cached in-process for the lifetime of the IMDS-issued certificate (minus a 5-minute safety margin).Subsequent calls return the cached token until it nears expiry.
89
91
90
-
### MakingDownstream mTLS Calls
92
+
### Path2 — MakingDownstream mTLS Calls
91
93
92
94
Once you have a token, use `httpRequest()` to make downstream calls over the same KeyGuard-backed mTLS channel:
"SystemAssigned", null, // identity type, identity id
104
106
false, // withAttestation
105
107
null, // correlationId
@@ -109,7 +111,65 @@ System.out.println(response.getStatus()); // e.g. 200
109
111
System.out.println(response.getBody());
110
112
```
111
113
112
-
The downstream server must be configured to *require* mutual TLS — it must send a TLS `CertificateRequest` during the handshake. Public Azure APIs (Graph, Key Vault, etc.) do not require a client certificate.
114
+
The downstream server must be configured to *require* mutual TLS — it must send a TLS `CertificateRequest` during the handshake.
ℹ️ 401 — TLS OK, authorization depends on permissions
199
+
200
+
=== Path 2 Complete ===
212
201
```
213
202
214
-
Attestation requires:
215
-
- Azure VM with vTPM or Trusted Launch enabled
216
-
- MAA (Microsoft Azure Attestation) service accessible from the VM
203
+
> **Expected HTTP 401 from graph.microsoft.com:** This is correct behavior. The TLS handshake and token were accepted — the managed identity simply has no Graph role assigned. HTTP 401 confirms the mTLS PoP flow succeeded end-to-end.
0 commit comments