Skip to content

Commit 7f8391e

Browse files
committed
updated the key storing condition
1 parent 275c785 commit 7f8391e

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

auth0/src/main/java/com/auth0/android/authentication/storage/BaseCredentialsManager.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public abstract class BaseCredentialsManager internal constructor(
3535
public abstract fun saveApiCredentials(
3636
apiCredentials: APICredentials,
3737
audience: String,
38-
scope: String?
38+
scope: String? = null
3939
)
4040

4141
public abstract fun getCredentials(callback: Callback<Credentials, CredentialsManagerException>)
@@ -170,7 +170,8 @@ public abstract class BaseCredentialsManager internal constructor(
170170
if (requiredScope == null) {
171171
return false
172172
}
173-
val storedScopes = storedScope.orEmpty().split(" ").filter { it.isNotEmpty() }.toMutableSet()
173+
val storedScopes =
174+
storedScope.orEmpty().split(" ").filter { it.isNotEmpty() }.toMutableSet()
174175
if (ignoreOpenid) {
175176
storedScopes.remove("openid")
176177
}
@@ -212,6 +213,6 @@ public abstract class BaseCredentialsManager internal constructor(
212213
*/
213214
protected fun getAPICredentialsKey(audience: String, scope: String?): String {
214215
// Use audience if scope is null else use a combination of audience and scope
215-
return if (scope == null) audience else "$audience::$scope"
216+
return if (scope == null) audience else "$audience::${scope.replace(" ","::")}"
216217
}
217218
}

0 commit comments

Comments
 (0)