Skip to content

Commit 1e2bb13

Browse files
committed
Address PR feedback
1 parent f92da95 commit 1e2bb13

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ protected ManagedIdentityResponse getSuccessfulResponse(IHttpResponse response)
9797
try {
9898
managedIdentityResponse = JsonHelper.convertJsonStringToJsonSerializableObject(response.body(), ManagedIdentityResponse::fromJson);
9999
} catch (MsalJsonParsingException e) {
100-
throw new MsalJsonParsingException(String.format(MsalErrorMessage.MANAGED_IDENTITY_RESPONSE_SUCCESSFUL_PARSE_FAILURE, e.getMessage()), MsalError.MANAGED_IDENTITY_RESPONSE_PARSE_FAILURE, managedIdentitySourceType);
100+
throw new MsalJsonParsingException(String.format(MsalErrorMessage.MANAGED_IDENTITY_RESPONSE_PARSE_FAILURE, response.statusCode(), e.getMessage()), MsalError.MANAGED_IDENTITY_RESPONSE_PARSE_FAILURE, managedIdentitySourceType);
101101
}
102102

103103
if (managedIdentityResponse == null || managedIdentityResponse.getAccessToken() == null
@@ -115,7 +115,7 @@ protected String getMessageFromErrorResponse(IHttpResponse response) {
115115
try {
116116
managedIdentityErrorResponse = JsonHelper.convertJsonToObject(response.body(), ManagedIdentityErrorResponse.class);
117117
} catch (MsalJsonParsingException e) {
118-
throw new MsalJsonParsingException(String.format(MsalErrorMessage.MANAGED_IDENTITY_RESPONSE_FAILED_PARSE_FAILURE, e.getMessage()), MsalError.MANAGED_IDENTITY_RESPONSE_PARSE_FAILURE, managedIdentitySourceType);
118+
throw new MsalJsonParsingException(String.format(MsalErrorMessage.MANAGED_IDENTITY_RESPONSE_PARSE_FAILURE, response.statusCode(), e.getMessage()), MsalError.MANAGED_IDENTITY_RESPONSE_PARSE_FAILURE, managedIdentitySourceType);
119119
}
120120

121121
if (managedIdentityErrorResponse == null) {

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,5 @@ class MsalErrorMessage {
2727

2828
public static final String GATEWAY_ERROR = "[Managed Identity] Authentication unavailable. The request failed due to a gateway error.";
2929

30-
public static final String MANAGED_IDENTITY_RESPONSE_SUCCESSFUL_PARSE_FAILURE = "[Managed Identity] MSI returned 200 OK, but the response could not be parsed: %s";
31-
32-
public static final String MANAGED_IDENTITY_RESPONSE_FAILED_PARSE_FAILURE = "[Managed Identity] MSI did not return 200 OK, and the response could not be parsed: %s";
30+
public static final String MANAGED_IDENTITY_RESPONSE_PARSE_FAILURE = "[Managed Identity] MSI returned %s, but the response could not be parsed: %s";
3331
}

0 commit comments

Comments
 (0)