diff --git a/forgerock-auth/src/main/java/org/forgerock/android/auth/FRAuth.java b/forgerock-auth/src/main/java/org/forgerock/android/auth/FRAuth.java index 52db439d..a34b34e5 100644 --- a/forgerock-auth/src/main/java/org/forgerock/android/auth/FRAuth.java +++ b/forgerock-auth/src/main/java/org/forgerock/android/auth/FRAuth.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 - 2023 ForgeRock. All rights reserved. + * Copyright (c) 2019 - 2024 ForgeRock. All rights reserved. * * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. @@ -30,6 +30,7 @@ */ public class FRAuth { + private static final String TAG = FRAuth.class.getSimpleName(); private AuthService authService; private SessionManager sessionManager; @@ -50,8 +51,12 @@ public static synchronized void start(Context context, @Nullable FROptions optio //Validate (AM URL, Realm, CookieName) is not Empty. If its empty will throw IllegalArgumentException. currentOptions.validateConfig(); if (ConfigHelper.isConfigDifferentFromPersistedValue(context, currentOptions)) { - SessionManager sessionManager = ConfigHelper.getPersistedConfig(context, cachedOptions).getSessionManager(); - sessionManager.close(); + try { + SessionManager sessionManager = ConfigHelper.getPersistedConfig(context, cachedOptions).getSessionManager(); + sessionManager.close(); + } catch (Exception e) { + Logger.warn(TAG, "Failed to close the session manager", e); + } } Config.getInstance().init(context, currentOptions); ConfigHelper.persist(context, currentOptions); diff --git a/forgerock-auth/src/main/java/org/forgerock/android/auth/FROptions.kt b/forgerock-auth/src/main/java/org/forgerock/android/auth/FROptions.kt index 86fe7c0a..cb55a4bc 100644 --- a/forgerock-auth/src/main/java/org/forgerock/android/auth/FROptions.kt +++ b/forgerock-auth/src/main/java/org/forgerock/android/auth/FROptions.kt @@ -46,7 +46,7 @@ data class FROptions(val server: Server, @Throws(IllegalArgumentException::class) @JvmName("validateConfig") internal fun validateConfig() { - require(server.url.isNotBlank()) { "AM URL cannot be blank" } + require(server.url.isNotBlank()) { "Server URL cannot be blank" } require(server.realm.isNotBlank()) { "Realm cannot be blank" } require(server.cookieName.isNotBlank()) { "cookieName cannot be blank" } } diff --git a/forgerock-auth/src/main/res/values/strings.xml b/forgerock-auth/src/main/res/values/strings.xml index 38d3b0cf..2d3d0326 100644 --- a/forgerock-auth/src/main/res/values/strings.xml +++ b/forgerock-auth/src/main/res/values/strings.xml @@ -15,10 +15,10 @@ place holder 30 0 - place holder + - place holder + root 30 0