diff --git a/libs/SalesforceSDK/src/com/salesforce/androidsdk/app/SalesforceSDKManager.kt b/libs/SalesforceSDK/src/com/salesforce/androidsdk/app/SalesforceSDKManager.kt index 4227353c75..27fa7459eb 100644 --- a/libs/SalesforceSDK/src/com/salesforce/androidsdk/app/SalesforceSDKManager.kt +++ b/libs/SalesforceSDK/src/com/salesforce/androidsdk/app/SalesforceSDKManager.kt @@ -24,6 +24,8 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ +@file:Suppress("DEPRECATION") // Imports and uses the deprecated IDPManager/SPManager types and IDP login flow APIs until they are removed in 15.0. + package com.salesforce.androidsdk.app import android.accounts.Account @@ -120,9 +122,6 @@ import com.salesforce.androidsdk.auth.OAuth2.revokeRefreshToken import com.salesforce.androidsdk.auth.RemoteAccessConsumerKeyProvider import com.salesforce.androidsdk.auth.dpop.DPoPKeyManager import com.salesforce.androidsdk.auth.dpop.DPoPNonceCache -import com.salesforce.androidsdk.auth.idp.SPConfig -import com.salesforce.androidsdk.auth.idp.interfaces.IDPManager -import com.salesforce.androidsdk.auth.idp.interfaces.SPManager import com.salesforce.androidsdk.config.AdminPermsManager import com.salesforce.androidsdk.config.AdminSettingsManager import com.salesforce.androidsdk.config.BootConfig.getBootConfig @@ -182,6 +181,8 @@ import java.util.regex.Pattern import kotlin.time.Duration.Companion.milliseconds import com.salesforce.androidsdk.auth.idp.IDPManager as DefaultIDPManager import com.salesforce.androidsdk.auth.idp.SPManager as DefaultSPManager +import com.salesforce.androidsdk.auth.idp.interfaces.IDPManager +import com.salesforce.androidsdk.auth.idp.interfaces.SPManager import com.salesforce.androidsdk.auth.interfaces.NativeLoginManager as NativeLoginManagerInterface import com.salesforce.androidsdk.security.interfaces.BiometricAuthenticationManager as BiometricAuthenticationManagerInterface import com.salesforce.androidsdk.security.interfaces.ScreenLockManager as ScreenLockManagerInterface @@ -680,23 +681,45 @@ open class SalesforceSDKManager protected constructor( }.getOrDefault("") + // Backing field for [idpManager]. The SDK reads this directly so its own internal use of the + // manager doesn't trigger the deprecation warning on the public property. + @Volatile + private var _idpManager: IDPManager? = null + + // Backing field for [spManager]. The SDK reads this directly so its own internal use of the + // manager doesn't trigger the deprecation warning on the public property. + @Volatile + private var _spManager: SPManager? = null + /** * The Salesforce SDK manager's admin settings manager. Only * defined if setAllowedSPApps() was called first */ - var idpManager: IDPManager? = null - private set + @Deprecated("The IDP (Identity Provider) login flow is deprecated and will be removed in " + + "Salesforce Mobile SDK 15.0. Apps should use advanced (browser-based) authentication.") + var idpManager: IDPManager? + get() = _idpManager + private set(value) { + _idpManager = value + } /** * The Salesforce SDK manager's SP manager. Only defined if * setIdpAppPackageName() was called first */ - var spManager: SPManager? = null - private set + @Deprecated("The IDP (Identity Provider) login flow is deprecated and will be removed in " + + "Salesforce Mobile SDK 15.0. Apps should use advanced (browser-based) authentication.") + var spManager: SPManager? + get() = _spManager + private set(value) { + _spManager = value + } /** Indicates if IDP login flow is enabled */ + @Deprecated("The IDP (Identity Provider) login flow is deprecated and will be removed in " + + "Salesforce Mobile SDK 15.0. Apps should use advanced (browser-based) authentication.") val isIDPLoginFlowEnabled - get() = spManager != null + get() = _spManager != null /** * The available Mobile SDK style themes. @@ -897,16 +920,18 @@ open class SalesforceSDKManager protected constructor( /** Indicates if this app is configured as an identity provider */ private val isIdentityProvider - get() = idpManager != null + get() = _idpManager != null /** * Sets the IDP package name for this app. * As a result, this app gets an SP Manager and can be used as an SP * @param idpAppPackageName The IDP app package name */ + @Deprecated("The IDP (Identity Provider) login flow is deprecated and will be removed in " + + "Salesforce Mobile SDK 15.0. Apps should use advanced (browser-based) authentication.") fun setIDPAppPackageName(idpAppPackageName: String?) { registerUsedAppFeature(FEATURE_APP_IS_SP) - spManager = idpAppPackageName?.let { DefaultSPManager(it) } + _spManager = idpAppPackageName?.let { DefaultSPManager(it) } } /** @@ -914,10 +939,12 @@ open class SalesforceSDKManager protected constructor( * As a result this app gets an IDP manager and can be used as an IDP * @param allowedSPApps The list of allows SP app */ - @Suppress("unused") - fun setAllowedSPApps(allowedSPApps: List) { + @Deprecated("The IDP (Identity Provider) login flow is deprecated and will be removed in " + + "Salesforce Mobile SDK 15.0. Apps should use advanced (browser-based) authentication.") + @Suppress("unused", "DEPRECATION") // References the deprecated SPConfig parameter type until it is removed in 15.0. + fun setAllowedSPApps(allowedSPApps: List) { registerUsedAppFeature(FEATURE_APP_IS_IDP) - idpManager = DefaultIDPManager(allowedSPApps) + _idpManager = DefaultIDPManager(allowedSPApps) } @@ -1776,6 +1803,7 @@ open class SalesforceSDKManager protected constructor( /** Information to display in the developer support dialog */ open val devSupportInfo: DevSupportInfo + // Reads the deprecated isIDPLoginFlowEnabled flag until it is removed in 15.0. get() { val userList = userAccountManager.authenticatedUsers?.joinToString(separator = ",\n") { "${it.displayName} (${it.username})" @@ -2123,6 +2151,7 @@ open class SalesforceSDKManager protected constructor( * @param context The Android context */ @JvmStatic + // Auto-wires the deprecated IDP login flow from MDM config until it is removed in 15.0. fun initInternal(context: Context) { // Upgrades to the latest version diff --git a/libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/idp/IDPAuthCodeActivity.kt b/libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/idp/IDPAuthCodeActivity.kt index 9ea4113c02..23a6febbf6 100644 --- a/libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/idp/IDPAuthCodeActivity.kt +++ b/libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/idp/IDPAuthCodeActivity.kt @@ -60,9 +60,11 @@ import androidx.compose.ui.viewinterop.AndroidView import com.salesforce.androidsdk.app.SalesforceSDKManager import com.salesforce.androidsdk.util.LogUtil import com.salesforce.androidsdk.util.SalesforceSDKLogger -import com.salesforce.androidsdk.auth.idp.interfaces.IDPAuthCodeActivity as IDPAuthCodeActivityInterface -class IDPAuthCodeActivity : ComponentActivity(), IDPAuthCodeActivityInterface { +@Deprecated("The IDP (Identity Provider) login flow is deprecated and will be removed in " + + "Salesforce Mobile SDK 15.0. Apps should use advanced (browser-based) authentication.") +@Suppress("DEPRECATION") // Implements the deprecated IDPAuthCodeActivity interface and reads the deprecated idpManager flag until they are removed in 15.0. +class IDPAuthCodeActivity : ComponentActivity(), com.salesforce.androidsdk.auth.idp.interfaces.IDPAuthCodeActivity { companion object { private val TAG: String = IDPAuthCodeActivity::class.java.simpleName diff --git a/libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/idp/IDPAuthCodeHelper.kt b/libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/idp/IDPAuthCodeHelper.kt index 0569e680f5..38f7233224 100644 --- a/libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/idp/IDPAuthCodeHelper.kt +++ b/libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/idp/IDPAuthCodeHelper.kt @@ -53,6 +53,7 @@ import java.net.URI /** * Helper class used in IDP app to get auth code from server */ +@Suppress("DEPRECATION") // Uses the deprecated SPConfig type until it is removed in 15.0. internal class IDPAuthCodeHelper @VisibleForTesting internal constructor( val webView: WebView, val userAccount: UserAccount, diff --git a/libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/idp/IDPManager.kt b/libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/idp/IDPManager.kt index 973a5519b7..ff653612dd 100644 --- a/libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/idp/IDPManager.kt +++ b/libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/idp/IDPManager.kt @@ -24,6 +24,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ +@file:Suppress("DEPRECATION") // Imports and uses the deprecated IDPManager/IDPAuthCodeActivity/Status types throughout until they are removed in 15.0. package com.salesforce.androidsdk.auth.idp import android.content.Context @@ -47,6 +48,7 @@ import com.salesforce.androidsdk.util.SalesforceSDKLogger * e.g. the context (activity) that started it * the web view to get the auth code in */ +@Suppress("DEPRECATION") // Uses the deprecated SPConfig/Status types until they are removed in 15.0. internal class IDPLoginFlow(context:Context, val user:UserAccount, val spConfig: SPConfig, val onStatusUpdate:(Status) -> Unit) : ActiveFlow(context) { var authCodeActivity: IDPAuthCodeActivity? = null @@ -70,6 +72,7 @@ internal class IDPLoginFlow(context:Context, val user:UserAccount, val spConfig: /** * Class handling IDP operations within an IDP app */ +@Suppress("DEPRECATION") // Implements the deprecated IDPManager interface and uses SPConfig/Status until they are removed in 15.0. internal class IDPManager( val allowedSPApps: List, // the following allows us to decouple IDPManager from other part of the SDK and make it easier to test diff --git a/libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/idp/IDPReceiver.kt b/libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/idp/IDPReceiver.kt index 66c48d9c4b..d1538980a7 100644 --- a/libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/idp/IDPReceiver.kt +++ b/libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/idp/IDPReceiver.kt @@ -37,7 +37,10 @@ import com.salesforce.androidsdk.util.SalesforceSDKLogger /** * Receiver running in IDP app handling calls from SP app */ +@Deprecated("The IDP (Identity Provider) login flow is deprecated and will be removed in " + + "Salesforce Mobile SDK 15.0. Apps should use advanced (browser-based) authentication.") class IDPReceiver : BroadcastReceiver() { + @Suppress("DEPRECATION") // Reads the deprecated idpManager flag until it is removed in 15.0. override fun onReceive(context: Context, intent: Intent) { SalesforceSDKManager.getInstance().idpManager?.onReceive(context, intent) ?: run { SalesforceSDKLogger.d(this::class.java.simpleName, "onReceive no idp manager to handle ${LogUtil.intentToString(intent)}") diff --git a/libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/idp/SPAuthCodeHelper.kt b/libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/idp/SPAuthCodeHelper.kt index 6fddb5b748..ee48c81065 100644 --- a/libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/idp/SPAuthCodeHelper.kt +++ b/libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/idp/SPAuthCodeHelper.kt @@ -41,6 +41,7 @@ import java.net.URI /** * Helper class used in SP app to get auth tokens and create user given auth code */ +@Suppress("DEPRECATION") // Uses the deprecated SPConfig type until it is removed in 15.0. internal class SPAuthCodeHelper private constructor ( val context: Context, val loginUrl: String, diff --git a/libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/idp/SPConfig.kt b/libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/idp/SPConfig.kt index 936d3e3461..7d3aaa6c17 100644 --- a/libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/idp/SPConfig.kt +++ b/libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/idp/SPConfig.kt @@ -32,6 +32,9 @@ import com.salesforce.androidsdk.config.BootConfig /** * SP app configuration */ +@Deprecated("The IDP (Identity Provider) login flow is deprecated and will be removed in " + + "Salesforce Mobile SDK 15.0. Apps should use advanced (browser-based) authentication.") +@Suppress("DEPRECATION") // References itself internally in equals()/hashCode()/forCurrentApp() until it is removed in 15.0. data class SPConfig ( val appPackageName: String, val componentName: String, @@ -41,6 +44,8 @@ data class SPConfig ( ) { companion object { @JvmStatic + @Deprecated("The IDP (Identity Provider) login flow is deprecated and will be removed in " + + "Salesforce Mobile SDK 15.0. Apps should use advanced (browser-based) authentication.") fun forCurrentApp(): SPConfig { val sdkMgr = SalesforceSDKManager.getInstance() return with(BootConfig.getBootConfig(sdkMgr.appContext)) { diff --git a/libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/idp/SPManager.kt b/libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/idp/SPManager.kt index e9d05b1156..53e42e1390 100644 --- a/libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/idp/SPManager.kt +++ b/libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/idp/SPManager.kt @@ -24,6 +24,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ +@file:Suppress("DEPRECATION") // Imports and uses the deprecated SPManager/Status types throughout until they are removed in 15.0. package com.salesforce.androidsdk.auth.idp import android.app.Activity @@ -49,6 +50,7 @@ import com.salesforce.androidsdk.util.SalesforceSDKLogger * - or the receiver context in the case it was started in response to a IDP login request * the code verifier */ +@Suppress("DEPRECATION") // Uses the deprecated Status type until it is removed in 15.0. internal class SPLoginFlow private constructor(context:Context, val onStatusUpdate: (Status) -> Unit) : ActiveFlow(context) { @@ -81,6 +83,7 @@ internal class SPLoginFlow private constructor(context:Context, val onStatusUpda /** * Class handling SP operations within a SP app */ +@Suppress("DEPRECATION") // Implements the deprecated SPManager interface and uses the Status type until they are removed in 15.0. internal class SPManager( private val idpAppPackageName: String, // the following allows us to decouple IDPManager from other part of the SDK and make it easier to test diff --git a/libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/idp/SPReceiver.kt b/libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/idp/SPReceiver.kt index 8501b35596..61ab949bb4 100644 --- a/libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/idp/SPReceiver.kt +++ b/libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/idp/SPReceiver.kt @@ -36,7 +36,10 @@ import com.salesforce.androidsdk.util.SalesforceSDKLogger /** * Receiver running in SP app handling calls from IDP app */ +@Deprecated("The IDP (Identity Provider) login flow is deprecated and will be removed in " + + "Salesforce Mobile SDK 15.0. Apps should use advanced (browser-based) authentication.") class SPReceiver : BroadcastReceiver() { + @Suppress("DEPRECATION") // Reads the deprecated spManager flag until it is removed in 15.0. override fun onReceive(context: Context, intent: Intent) { SalesforceSDKManager.getInstance().spManager?.onReceive(context, intent) ?: run { SalesforceSDKLogger.d(this::class.java.simpleName, "onReceive no sp manager to handle ${LogUtil.intentToString(intent)}") diff --git a/libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/idp/interfaces/IDPAuthCodeActivity.kt b/libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/idp/interfaces/IDPAuthCodeActivity.kt index ebfa4fe89d..8e1167b949 100644 --- a/libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/idp/interfaces/IDPAuthCodeActivity.kt +++ b/libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/idp/interfaces/IDPAuthCodeActivity.kt @@ -28,6 +28,8 @@ package com.salesforce.androidsdk.auth.idp.interfaces import android.webkit.WebView +@Deprecated("The IDP (Identity Provider) login flow is deprecated and will be removed in " + + "Salesforce Mobile SDK 15.0. Apps should use advanced (browser-based) authentication.") interface IDPAuthCodeActivity { val webView: WebView diff --git a/libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/idp/interfaces/IDPManager.kt b/libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/idp/interfaces/IDPManager.kt index 79adcca6ad..3b416abf7d 100644 --- a/libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/idp/interfaces/IDPManager.kt +++ b/libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/idp/interfaces/IDPManager.kt @@ -30,8 +30,13 @@ import android.content.Context import android.content.Intent import com.salesforce.androidsdk.R +@Deprecated("The IDP (Identity Provider) login flow is deprecated and will be removed in " + + "Salesforce Mobile SDK 15.0. Apps should use advanced (browser-based) authentication.") +@Suppress("DEPRECATION") // Members below reference the deprecated Status/StatusUpdateCallback types until they are removed in 15.0. interface IDPManager { + @Deprecated("The IDP (Identity Provider) login flow is deprecated and will be removed in " + + "Salesforce Mobile SDK 15.0. Apps should use advanced (browser-based) authentication.") enum class Status(val resIdForDescription: Int) { LOGIN_REQUEST_SENT_TO_SP(R.string.sf__login_request_sent_to_sp), GETTING_AUTH_CODE_FROM_SERVER(R.string.sf__getting_auth_code_from_server), @@ -41,6 +46,8 @@ interface IDPManager { SP_LOGIN_COMPLETE(R.string.sf__sp_login_complete) } + @Deprecated("The IDP (Identity Provider) login flow is deprecated and will be removed in " + + "Salesforce Mobile SDK 15.0. Apps should use advanced (browser-based) authentication.") interface StatusUpdateCallback { fun onStatusUpdate(status: Status) } diff --git a/libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/idp/interfaces/SPManager.kt b/libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/idp/interfaces/SPManager.kt index 17c63e3c49..5416a20490 100644 --- a/libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/idp/interfaces/SPManager.kt +++ b/libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/idp/interfaces/SPManager.kt @@ -30,8 +30,13 @@ import android.content.Context import android.content.Intent import com.salesforce.androidsdk.R +@Deprecated("The IDP (Identity Provider) login flow is deprecated and will be removed in " + + "Salesforce Mobile SDK 15.0. Apps should use advanced (browser-based) authentication.") +@Suppress("DEPRECATION") // Members below reference the deprecated Status/StatusUpdateCallback types until they are removed in 15.0. interface SPManager { + @Deprecated("The IDP (Identity Provider) login flow is deprecated and will be removed in " + + "Salesforce Mobile SDK 15.0. Apps should use advanced (browser-based) authentication.") enum class Status(val resIdForDescription:Int) { FAILED_TO_SEND_REQUEST_TO_IDP(R.string.sf__failed_to_send_request_to_idp), LOGIN_REQUEST_SENT_TO_IDP(R.string.sf__login_request_sent_to_idp), @@ -40,6 +45,8 @@ interface SPManager { FAILED_TO_EXCHANGE_AUTHORIZATION_CODE(R.string.sf__failed_to_exchange_authorization_code), LOGIN_COMPLETE(R.string.sf__login_complete) } + @Deprecated("The IDP (Identity Provider) login flow is deprecated and will be removed in " + + "Salesforce Mobile SDK 15.0. Apps should use advanced (browser-based) authentication.") interface StatusUpdateCallback { fun onStatusUpdate(status: Status) } diff --git a/libs/SalesforceSDK/src/com/salesforce/androidsdk/config/RuntimeConfig.java b/libs/SalesforceSDK/src/com/salesforce/androidsdk/config/RuntimeConfig.java index e39373fa09..20f80a6544 100644 --- a/libs/SalesforceSDK/src/com/salesforce/androidsdk/config/RuntimeConfig.java +++ b/libs/SalesforceSDK/src/com/salesforce/androidsdk/config/RuntimeConfig.java @@ -61,6 +61,12 @@ public enum ConfigKey { RequireCertAuth, ManagedAppCertAlias, OnlyShowAuthorizedHosts, + + /** + * @deprecated The IDP (Identity Provider) login flow is deprecated and will be removed + * in Salesforce Mobile SDK 15.0. Apps should use advanced (browser-based) authentication. + */ + @Deprecated IDPAppPackageName } diff --git a/libs/SalesforceSDK/src/com/salesforce/androidsdk/ui/LoginActivity.kt b/libs/SalesforceSDK/src/com/salesforce/androidsdk/ui/LoginActivity.kt index 9a6e4a0be9..0fab46db8e 100644 --- a/libs/SalesforceSDK/src/com/salesforce/androidsdk/ui/LoginActivity.kt +++ b/libs/SalesforceSDK/src/com/salesforce/androidsdk/ui/LoginActivity.kt @@ -157,8 +157,6 @@ import com.salesforce.androidsdk.app.SalesforceSDKManager.Theme.DARK import com.salesforce.androidsdk.auth.OAuth2.OAuthFailedException import com.salesforce.androidsdk.auth.OAuth2.TokenEndpointResponse import com.salesforce.androidsdk.auth.OAuthErrorCode -import com.salesforce.androidsdk.auth.idp.interfaces.SPManager.Status -import com.salesforce.androidsdk.auth.idp.interfaces.SPManager.StatusUpdateCallback import com.salesforce.androidsdk.config.LoginServerManager import com.salesforce.androidsdk.config.RuntimeConfig.ConfigKey.ManagedAppCertAlias import com.salesforce.androidsdk.config.RuntimeConfig.ConfigKey.RequireCertAuth @@ -901,8 +899,9 @@ open class LoginActivity : FragmentActivity() { } } - internal inner class SPStatusCallback : StatusUpdateCallback { - override fun onStatusUpdate(status: Status) { + @Suppress("DEPRECATION") // Implements the deprecated StatusUpdateCallback/Status types until they are removed in 15.0. + internal inner class SPStatusCallback : com.salesforce.androidsdk.auth.idp.interfaces.SPManager.StatusUpdateCallback { + override fun onStatusUpdate(status: com.salesforce.androidsdk.auth.idp.interfaces.SPManager.Status) { runOnUiThread { makeText( applicationContext, @@ -1079,6 +1078,9 @@ open class LoginActivity : FragmentActivity() { /** * Called when the IDP login button is clicked. */ + @Deprecated("The IDP (Identity Provider) login flow is deprecated and will be removed in " + + "Salesforce Mobile SDK 15.0. Apps should use advanced (browser-based) authentication.") + @Suppress("DEPRECATION") // Reads the deprecated spManager flag until it is removed in 15.0. open fun onIDPLoginClick() { SalesforceSDKManager.getInstance().spManager?.kickOffSPInitiatedLoginFlow( this, diff --git a/libs/SalesforceSDK/src/com/salesforce/androidsdk/ui/LoginViewModel.kt b/libs/SalesforceSDK/src/com/salesforce/androidsdk/ui/LoginViewModel.kt index 5f32bb4b11..f54b4f35ef 100644 --- a/libs/SalesforceSDK/src/com/salesforce/androidsdk/ui/LoginViewModel.kt +++ b/libs/SalesforceSDK/src/com/salesforce/androidsdk/ui/LoginViewModel.kt @@ -179,6 +179,7 @@ open class LoginViewModel( internal var previousPendingServer: String? = null internal val authFinished = mutableStateOf(false) + @Suppress("DEPRECATION") // Reads the deprecated isIDPLoginFlowEnabled flag until it is removed in 15.0. internal val isIDPLoginFlowEnabled = derivedStateOf { SalesforceSDKManager.getInstance().isIDPLoginFlowEnabled } diff --git a/libs/SalesforceSDK/src/com/salesforce/androidsdk/ui/components/LoginView.kt b/libs/SalesforceSDK/src/com/salesforce/androidsdk/ui/components/LoginView.kt index fc8d93088d..80ad416da9 100644 --- a/libs/SalesforceSDK/src/com/salesforce/androidsdk/ui/components/LoginView.kt +++ b/libs/SalesforceSDK/src/com/salesforce/androidsdk/ui/components/LoginView.kt @@ -208,6 +208,7 @@ fun LoginView() { viewModel.biometricAuthenticationButtonAction.value?.invoke() ?: activity.onBioAuthClick() } } else null + @Suppress("DEPRECATION") // Calls the deprecated onIDPLoginClick until it is removed in 15.0. val idpButton = if (viewModel.isIDPLoginFlowEnabled.value) { LoginViewModel.BottomBarButton(stringResource(sf__launch_idp)) { diff --git a/libs/test/SalesforceSDKTest/src/com/salesforce/androidsdk/app/PublicOverridesTest.kt b/libs/test/SalesforceSDKTest/src/com/salesforce/androidsdk/app/PublicOverridesTest.kt index 361990c6cc..7265c6bf53 100644 --- a/libs/test/SalesforceSDKTest/src/com/salesforce/androidsdk/app/PublicOverridesTest.kt +++ b/libs/test/SalesforceSDKTest/src/com/salesforce/androidsdk/app/PublicOverridesTest.kt @@ -32,6 +32,9 @@ import org.junit.runner.RunWith internal class PublicOverridesTest { private val context = InstrumentationRegistry.getInstrumentation().context + // onIDPLoginClick() is deprecated (IDP flow, 14.0 → removal targeted for 15.0); overriding it + // here only verifies the override point still exists, so suppress the deprecation warning. + @Suppress("DEPRECATION") @Test fun overrideLoginActivity() { class OverrideLoginActivity : LoginActivity() { diff --git a/libs/test/SalesforceSDKTest/src/com/salesforce/androidsdk/auth/idp/IDPAuthCodeHelperTest.kt b/libs/test/SalesforceSDKTest/src/com/salesforce/androidsdk/auth/idp/IDPAuthCodeHelperTest.kt index 7b87271fe0..8cacd33b49 100644 --- a/libs/test/SalesforceSDKTest/src/com/salesforce/androidsdk/auth/idp/IDPAuthCodeHelperTest.kt +++ b/libs/test/SalesforceSDKTest/src/com/salesforce/androidsdk/auth/idp/IDPAuthCodeHelperTest.kt @@ -24,6 +24,10 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ +// This suite exercises the IDP/SP login flow, which is deprecated (14.0, removal targeted for 15.0). +// The flow still ships and must keep working, so the tests intentionally use the deprecated APIs. +@file:Suppress("DEPRECATION") + package com.salesforce.androidsdk.auth.idp import android.accounts.Account diff --git a/libs/test/SalesforceSDKTest/src/com/salesforce/androidsdk/auth/idp/IDPManagerTest.kt b/libs/test/SalesforceSDKTest/src/com/salesforce/androidsdk/auth/idp/IDPManagerTest.kt index 597b3c75eb..301c3ce56a 100644 --- a/libs/test/SalesforceSDKTest/src/com/salesforce/androidsdk/auth/idp/IDPManagerTest.kt +++ b/libs/test/SalesforceSDKTest/src/com/salesforce/androidsdk/auth/idp/IDPManagerTest.kt @@ -24,6 +24,10 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ +// This suite exercises the IDP/SP login flow, which is deprecated (14.0, removal targeted for 15.0). +// The flow still ships and must keep working, so the tests intentionally use the deprecated APIs. +@file:Suppress("DEPRECATION") + package com.salesforce.androidsdk.auth.idp import android.content.Context diff --git a/libs/test/SalesforceSDKTest/src/com/salesforce/androidsdk/auth/idp/SPManagerTest.kt b/libs/test/SalesforceSDKTest/src/com/salesforce/androidsdk/auth/idp/SPManagerTest.kt index 5e285c9db7..86db93ee74 100644 --- a/libs/test/SalesforceSDKTest/src/com/salesforce/androidsdk/auth/idp/SPManagerTest.kt +++ b/libs/test/SalesforceSDKTest/src/com/salesforce/androidsdk/auth/idp/SPManagerTest.kt @@ -24,6 +24,10 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ +// This suite exercises the IDP/SP login flow, which is deprecated (14.0, removal targeted for 15.0). +// The flow still ships and must keep working, so the tests intentionally use the deprecated APIs. +@file:Suppress("DEPRECATION") + package com.salesforce.androidsdk.auth.idp import android.app.Activity