File tree Expand file tree Collapse file tree 3 files changed +11
-1
lines changed
auth0/src/main/java/com/auth0/android/authentication/storage Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 11package com.auth0.android.authentication.storage
22
3+ import android.util.Log
34import androidx.annotation.VisibleForTesting
45import com.auth0.android.authentication.AuthenticationAPIClient
56import com.auth0.android.callback.Callback
@@ -213,6 +214,9 @@ public abstract class BaseCredentialsManager internal constructor(
213214 */
214215 protected fun getAPICredentialsKey (audience : String , scope : String? ): String {
215216 // Use audience if scope is null else use a combination of audience and scope
216- return if (scope == null ) audience else " $audience ::${scope.replace(" " ," ::" )} "
217+ if (scope == null ) return audience
218+ val sortedScope = scope.split(" " ).sorted().joinToString(" ::" )
219+ return " $audience ::${sortedScope} "
220+
217221 }
218222}
Original file line number Diff line number Diff line change @@ -717,6 +717,9 @@ public class CredentialsManager @VisibleForTesting(otherwise = VisibleForTesting
717717
718718 /* *
719719 * Removes the credentials for the given audience from the storage if present.
720+ * @param audience Audience for which the [APICredentials] are stored
721+ * @param scope Optional scope for which the [APICredentials] are stored. If the credentials were initially fetched/stored with scope,
722+ * it is recommended to pass scope also while clearing them.
720723 */
721724 override fun clearApiCredentials (audience : String , scope : String? ) {
722725 val key = getAPICredentialsKey(audience, scope)
Original file line number Diff line number Diff line change @@ -764,6 +764,9 @@ public class SecureCredentialsManager @VisibleForTesting(otherwise = VisibleForT
764764
765765 /* *
766766 * Removes the credentials for the given audience from the storage if present.
767+ * @param audience Audience for which the [APICredentials] are stored
768+ * @param scope Optional scope for which the [APICredentials] are stored. If the credentials were initially fetched/stored with scope,
769+ * it is recommended to pass scope also while clearing them.
767770 */
768771 override fun clearApiCredentials (audience : String , scope : String? ) {
769772 val key = getAPICredentialsKey(audience, scope)
You can’t perform that action at this time.
0 commit comments