Skip to content

Commit 3b19c13

Browse files
Fixed parsing ClientInfo: on some accounts, the server response contained characters that are incorrect for Base64 encoding, but acceptable for Base64URL (#282)
1 parent cf9c1a4 commit 3b19c13

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/main/java/com/microsoft/aad/msal4j/ClientInfo.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,19 @@ class ClientInfo {
1919
private String uniqueIdentifier;
2020

2121
@JsonProperty("utid")
22-
private String unqiueTenantIdentifier;
22+
private String uniqueTenantIdentifier;
2323

2424
public static ClientInfo createFromJson(String clientInfoJsonBase64Encoded){
2525
if(StringHelper.isBlank(clientInfoJsonBase64Encoded)){
26-
return null;
26+
return null;
2727
}
28-
byte[] decodedInput = Base64.getDecoder().decode(clientInfoJsonBase64Encoded.getBytes(StandardCharset.UTF_8));
28+
29+
byte[] decodedInput = Base64.getUrlDecoder().decode(clientInfoJsonBase64Encoded.getBytes(StandardCharset.UTF_8));
2930

3031
return JsonHelper.convertJsonToObject(new String(decodedInput, StandardCharset.UTF_8), ClientInfo.class);
3132
}
3233

3334
String toAccountIdentifier(){
34-
return uniqueIdentifier + POINT_DELIMITER + unqiueTenantIdentifier;
35+
return uniqueIdentifier + POINT_DELIMITER + uniqueTenantIdentifier;
3536
}
3637
}

0 commit comments

Comments
 (0)