Skip to content

Commit 8e2945d

Browse files
committed
PR feedback
1 parent c8d33fd commit 8e2945d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/DefaultHttpClientManagedIdentity.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
import java.security.cert.CertificateException;
2424
import java.security.cert.X509Certificate;
2525

26+
/** An extension for the default HttpClient which is meant to perform any extra HTTP behavior needed for a managed identity flow.
27+
* <p>
28+
* Currently the only extra behavior is the Service Fabric flow, where we must add a certificate thumbprint to the HTTP connection.
29+
*/
2630
class DefaultHttpClientManagedIdentity extends DefaultHttpClient {
2731

2832
public static final HostnameVerifier ALL_HOSTS_ACCEPT_HOSTNAME_VERIFIER;

msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/ServiceFabricManagedIdentitySource.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ class ServiceFabricManagedIdentitySource extends AbstractManagedIdentitySource {
2424
private final String userAssignedId;
2525

2626
//Service Fabric requires a special check for an environment variable containing a certificate thumbprint used for validating requests.
27-
//
2827
//No other flow need this and an app developer may not be aware of it, so it was decided that for the Service Fabric flow we will simply override
2928
// any HttpClient that may have been set by the app developer with our own client which performs the validation logic.
3029
private final IHttpClient httpClient = new DefaultHttpClientManagedIdentity(null, null, null, null);
@@ -80,7 +79,7 @@ public ManagedIdentityResponse getManagedIdentityResponse(
8079
managedIdentityRequest.getBodyAsString());
8180

8281
response = httpHelper.executeHttpRequest(httpRequest, managedIdentityRequest.requestContext(), serviceBundle.getTelemetryManager(),
83-
new DefaultHttpClientManagedIdentity(null, null, null, null));
82+
httpClient);
8483
} catch (URISyntaxException e) {
8584
throw new RuntimeException(e);
8685
} catch (MsalClientException e) {

0 commit comments

Comments
 (0)