From 68eed0fbfd55193e702a5129e859c91d1fc1e4e6 Mon Sep 17 00:00:00 2001 From: Takashi Arai Date: Thu, 27 Aug 2026 12:56:43 -1000 Subject: [PATCH 1/3] Deprecate IDP (Identity Provider) login flow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mark the IDP login flow's public API as deprecated (deprecated in 14.0, targeted for removal in 15.0). As Mobile SDK moves to advanced (browser-based) authentication as the default and only auth mechanism, the IDP flow — where one app acts as an identity provider so other service-provider apps log in without their own browser round-trip — is being retired. There is no drop-in replacement; apps should use advanced (browser-based) authentication. This change only adds deprecation annotations. It does not remove the flow or change any runtime behavior — IDP keeps working in 14.0. - @Deprecated(...) on the public IDP entry points: SalesforceSDKManager (idpManager, spManager, isIDPLoginFlowEnabled, setIDPAppPackageName, setAllowedSPApps); auth.idp.interfaces.IDPManager / SPManager / IDPAuthCodeActivity; auth.idp.SPConfig; the concrete IDPAuthCodeActivity, IDPReceiver, SPReceiver; LoginActivity.onIDPLoginClick(); RuntimeConfig.ConfigKey.IDPAppPackageName. - Internal usages suppressed with scoped @Suppress("DEPRECATION") so the SDK still builds warning-clean. Mirrors the useWebServerAuthentication (OAuth user agent flow) deprecation landed the same release. --- .../androidsdk/app/SalesforceSDKManager.kt | 28 ++++++++++++++----- .../auth/idp/IDPAuthCodeActivity.kt | 6 ++-- .../androidsdk/auth/idp/IDPAuthCodeHelper.kt | 1 + .../androidsdk/auth/idp/IDPManager.kt | 3 ++ .../androidsdk/auth/idp/IDPReceiver.kt | 3 ++ .../androidsdk/auth/idp/SPAuthCodeHelper.kt | 1 + .../androidsdk/auth/idp/SPConfig.kt | 5 ++++ .../androidsdk/auth/idp/SPManager.kt | 3 ++ .../androidsdk/auth/idp/SPReceiver.kt | 3 ++ .../idp/interfaces/IDPAuthCodeActivity.kt | 2 ++ .../auth/idp/interfaces/IDPManager.kt | 7 +++++ .../auth/idp/interfaces/SPManager.kt | 7 +++++ .../androidsdk/config/RuntimeConfig.java | 6 ++++ .../salesforce/androidsdk/ui/LoginActivity.kt | 10 ++++--- .../androidsdk/ui/LoginViewModel.kt | 1 + .../androidsdk/ui/components/LoginView.kt | 1 + .../androidsdk/app/PublicOverridesTest.kt | 3 ++ .../auth/idp/IDPAuthCodeHelperTest.kt | 4 +++ .../androidsdk/auth/idp/IDPManagerTest.kt | 4 +++ .../androidsdk/auth/idp/SPManagerTest.kt | 4 +++ 20 files changed, 89 insertions(+), 13 deletions(-) diff --git a/libs/SalesforceSDK/src/com/salesforce/androidsdk/app/SalesforceSDKManager.kt b/libs/SalesforceSDK/src/com/salesforce/androidsdk/app/SalesforceSDKManager.kt index 4227353c75..38ead0e476 100644 --- a/libs/SalesforceSDK/src/com/salesforce/androidsdk/app/SalesforceSDKManager.kt +++ b/libs/SalesforceSDK/src/com/salesforce/androidsdk/app/SalesforceSDKManager.kt @@ -120,9 +120,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 @@ -684,18 +681,27 @@ open class SalesforceSDKManager protected constructor( * The Salesforce SDK manager's admin settings manager. Only * defined if setAllowedSPApps() was called first */ - var idpManager: IDPManager? = null + @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 the deprecated IDPManager type until it is removed in 15.0. + var idpManager: com.salesforce.androidsdk.auth.idp.interfaces.IDPManager? = null private set /** * The Salesforce SDK manager's SP manager. Only defined if * setIdpAppPackageName() was called first */ - var spManager: SPManager? = null + @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 the deprecated SPManager type until it is removed in 15.0. + var spManager: com.salesforce.androidsdk.auth.idp.interfaces.SPManager? = null private set /** 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 + @Suppress("DEPRECATION") // Reads the deprecated spManager flag until it is removed in 15.0. get() = spManager != null /** @@ -896,6 +902,7 @@ open class SalesforceSDKManager protected constructor( } /** Indicates if this app is configured as an identity provider */ + @Suppress("DEPRECATION") // Reads the deprecated idpManager flag until it is removed in 15.0. private val isIdentityProvider get() = idpManager != null @@ -904,6 +911,9 @@ open class SalesforceSDKManager protected constructor( * 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.") + @Suppress("DEPRECATION") // Sets the deprecated spManager flag until it is removed in 15.0. fun setIDPAppPackageName(idpAppPackageName: String?) { registerUsedAppFeature(FEATURE_APP_IS_SP) spManager = idpAppPackageName?.let { DefaultSPManager(it) } @@ -914,8 +924,10 @@ 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") // Sets the deprecated idpManager flag until it is removed in 15.0. + fun setAllowedSPApps(allowedSPApps: List) { registerUsedAppFeature(FEATURE_APP_IS_IDP) idpManager = DefaultIDPManager(allowedSPApps) } @@ -1776,6 +1788,7 @@ open class SalesforceSDKManager protected constructor( /** Information to display in the developer support dialog */ open val devSupportInfo: DevSupportInfo + @Suppress("DEPRECATION") // 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 +2136,7 @@ open class SalesforceSDKManager protected constructor( * @param context The Android context */ @JvmStatic + @Suppress("DEPRECATION") // 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 From 93c6cb2ed68edbba5649596577aa0bf3411c0dd4 Mon Sep 17 00:00:00 2001 From: Takashi Arai Date: Thu, 27 Aug 2026 14:09:58 -1000 Subject: [PATCH 2/3] Route internal IDP/SP manager access through backing fields Address review feedback: mirror the useWebServerAuthentication backing-field pattern so the SDK's own use of idpManager/spManager doesn't need scattered @Suppress("DEPRECATION"). Add @Volatile private _idpManager/_spManager backing fields; the public deprecated properties delegate to them, and the manager's internal null checks and setters read/write the backing fields directly. Drops the in-manager suppressions on isIDPLoginFlowEnabled, isIdentityProvider, and setIDPAppPackageName. The public properties and backing fields keep one suppression each because their type is the deprecated interface, and setAllowedSPApps keeps one for its deprecated SPConfig parameter. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../androidsdk/app/SalesforceSDKManager.kt | 39 +++++++++++++------ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/libs/SalesforceSDK/src/com/salesforce/androidsdk/app/SalesforceSDKManager.kt b/libs/SalesforceSDK/src/com/salesforce/androidsdk/app/SalesforceSDKManager.kt index 38ead0e476..db8505617d 100644 --- a/libs/SalesforceSDK/src/com/salesforce/androidsdk/app/SalesforceSDKManager.kt +++ b/libs/SalesforceSDK/src/com/salesforce/androidsdk/app/SalesforceSDKManager.kt @@ -677,6 +677,18 @@ 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 + @Suppress("DEPRECATION") // References the deprecated IDPManager type until it is removed in 15.0. + private var _idpManager: com.salesforce.androidsdk.auth.idp.interfaces.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 + @Suppress("DEPRECATION") // References the deprecated SPManager type until it is removed in 15.0. + private var _spManager: com.salesforce.androidsdk.auth.idp.interfaces.SPManager? = null + /** * The Salesforce SDK manager's admin settings manager. Only * defined if setAllowedSPApps() was called first @@ -684,8 +696,11 @@ open class SalesforceSDKManager protected constructor( @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 the deprecated IDPManager type until it is removed in 15.0. - var idpManager: com.salesforce.androidsdk.auth.idp.interfaces.IDPManager? = null - private set + var idpManager: com.salesforce.androidsdk.auth.idp.interfaces.IDPManager? + get() = _idpManager + private set(value) { + _idpManager = value + } /** * The Salesforce SDK manager's SP manager. Only defined if @@ -694,15 +709,17 @@ open class SalesforceSDKManager protected constructor( @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 the deprecated SPManager type until it is removed in 15.0. - var spManager: com.salesforce.androidsdk.auth.idp.interfaces.SPManager? = null - private set + var spManager: com.salesforce.androidsdk.auth.idp.interfaces.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 - @Suppress("DEPRECATION") // Reads the deprecated spManager flag until it is removed in 15.0. - get() = spManager != null + get() = _spManager != null /** * The available Mobile SDK style themes. @@ -902,9 +919,8 @@ open class SalesforceSDKManager protected constructor( } /** Indicates if this app is configured as an identity provider */ - @Suppress("DEPRECATION") // Reads the deprecated idpManager flag until it is removed in 15.0. private val isIdentityProvider - get() = idpManager != null + get() = _idpManager != null /** * Sets the IDP package name for this app. @@ -913,10 +929,9 @@ open class SalesforceSDKManager protected constructor( */ @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") // Sets the deprecated spManager flag until it is removed in 15.0. fun setIDPAppPackageName(idpAppPackageName: String?) { registerUsedAppFeature(FEATURE_APP_IS_SP) - spManager = idpAppPackageName?.let { DefaultSPManager(it) } + _spManager = idpAppPackageName?.let { DefaultSPManager(it) } } /** @@ -926,10 +941,10 @@ open class SalesforceSDKManager protected constructor( */ @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") // Sets the deprecated idpManager flag until it is removed in 15.0. + @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) } From dd1325c101e89ae6e7f68f2ca08c28e78cf7eac5 Mon Sep 17 00:00:00 2001 From: Takashi Arai Date: Fri, 28 Aug 2026 14:43:53 -1000 Subject: [PATCH 3/3] Use imported IDPManager/SPManager types with file-level DEPRECATION suppress Replace the fully-qualified com.salesforce.androidsdk.auth.idp.interfaces type names on the idpManager/spManager signatures with imported short names, and move the per-declaration @Suppress("DEPRECATION") annotations to a single @file:Suppress, matching the pattern already used in IDPManager.kt and SPManager.kt. --- .../androidsdk/app/SalesforceSDKManager.kt | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/libs/SalesforceSDK/src/com/salesforce/androidsdk/app/SalesforceSDKManager.kt b/libs/SalesforceSDK/src/com/salesforce/androidsdk/app/SalesforceSDKManager.kt index db8505617d..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 @@ -179,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,14 +684,12 @@ open class SalesforceSDKManager protected constructor( // 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 - @Suppress("DEPRECATION") // References the deprecated IDPManager type until it is removed in 15.0. - private var _idpManager: com.salesforce.androidsdk.auth.idp.interfaces.IDPManager? = null + 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 - @Suppress("DEPRECATION") // References the deprecated SPManager type until it is removed in 15.0. - private var _spManager: com.salesforce.androidsdk.auth.idp.interfaces.SPManager? = null + private var _spManager: SPManager? = null /** * The Salesforce SDK manager's admin settings manager. Only @@ -695,8 +697,7 @@ open class SalesforceSDKManager protected constructor( */ @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 the deprecated IDPManager type until it is removed in 15.0. - var idpManager: com.salesforce.androidsdk.auth.idp.interfaces.IDPManager? + var idpManager: IDPManager? get() = _idpManager private set(value) { _idpManager = value @@ -708,8 +709,7 @@ open class SalesforceSDKManager protected constructor( */ @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 the deprecated SPManager type until it is removed in 15.0. - var spManager: com.salesforce.androidsdk.auth.idp.interfaces.SPManager? + var spManager: SPManager? get() = _spManager private set(value) { _spManager = value @@ -1803,7 +1803,7 @@ open class SalesforceSDKManager protected constructor( /** Information to display in the developer support dialog */ open val devSupportInfo: DevSupportInfo - @Suppress("DEPRECATION") // Reads the deprecated isIDPLoginFlowEnabled flag until it is removed in 15.0. + // Reads the deprecated isIDPLoginFlowEnabled flag until it is removed in 15.0. get() { val userList = userAccountManager.authenticatedUsers?.joinToString(separator = ",\n") { "${it.displayName} (${it.username})" @@ -2151,7 +2151,7 @@ open class SalesforceSDKManager protected constructor( * @param context The Android context */ @JvmStatic - @Suppress("DEPRECATION") // Auto-wires the deprecated IDP login flow from MDM config until it is removed in 15.0. + // 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