diff --git a/adal/src/main/java/com/microsoft/aad/adal/StringExtensions.java b/adal/src/main/java/com/microsoft/aad/adal/StringExtensions.java index 8b2e8e67a..51b7e8c9f 100644 --- a/adal/src/main/java/com/microsoft/aad/adal/StringExtensions.java +++ b/adal/src/main/java/com/microsoft/aad/adal/StringExtensions.java @@ -50,9 +50,4 @@ public static String createHash(String msg) throws NoSuchAlgorithmException, UnsupportedEncodingException { return com.microsoft.identity.common.adal.internal.util.StringExtensions.createHash(msg); } - - public static String encodeBase64URLSafeString(final byte[] bytes) - throws UnsupportedEncodingException { - return com.microsoft.identity.common.adal.internal.util.StringExtensions.encodeBase64URLSafeString(bytes); - } } \ No newline at end of file diff --git a/adal/src/main/java/com/microsoft/aad/adal/TokenCacheAccessor.java b/adal/src/main/java/com/microsoft/aad/adal/TokenCacheAccessor.java index 28a1c1228..b09d45db5 100644 --- a/adal/src/main/java/com/microsoft/aad/adal/TokenCacheAccessor.java +++ b/adal/src/main/java/com/microsoft/aad/adal/TokenCacheAccessor.java @@ -23,6 +23,7 @@ package com.microsoft.aad.adal; import android.content.Context; +import android.util.Base64; import androidx.annotation.NonNull; @@ -49,6 +50,7 @@ import java.net.MalformedURLException; import java.net.URL; +import java.nio.charset.Charset; import java.util.ArrayList; import java.util.Iterator; import java.util.List; @@ -656,7 +658,12 @@ private void addDeletionKeyForFRTIfRTValueIsStale(final List keysToRemov } private String getUniqueIdentifierForCacheKey(final String userId, final String tenantId) { - return StringExtensions.base64UrlEncodeToString(userId) + "." + StringExtensions.base64UrlEncodeToString(tenantId); + return getEncodedStringForKey(userId) + "." + getEncodedStringForKey(tenantId); + } + + private String getEncodedStringForKey(final String message) { + return Base64.encodeToString(message.getBytes(Charset.forName(AuthenticationConstants.ENCODING_UTF8)), + Base64.URL_SAFE | Base64.NO_WRAP); } private boolean isUserMisMatch(final String user, final TokenCacheItem tokenCacheItem) { diff --git a/changelog.txt b/changelog.txt index f97af1caf..a6e517b85 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,8 @@ +vNext +--------- +- [PATCH] Migrate Base64 away from Msebera + + Version 4.8.15 --------- - [PATCH] Update common @18.1.0 diff --git a/common b/common index 944252ace..fc41b4c4e 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 944252ace420a3ebfc0fc0d126ca47084e084a8f +Subproject commit fc41b4c4e67752f3a0d520c69f8598070f2ae38a diff --git a/gradle/versions.gradle b/gradle/versions.gradle index d7d4f2303..fc8094596 100644 --- a/gradle/versions.gradle +++ b/gradle/versions.gradle @@ -48,7 +48,6 @@ ext { daggerVersion = "2.31.2" daggerCompilerVersion = "2.31.2" msal4jVersion = "1.10.0" - mseberaApacheHttpClientVersion = "4.5.8" moshiVersion = "1.14.0" moshiAdaptersVersion = "1.14.0" openpojoVersion = "0.9.1"