Skip to content

Deprecate IDP (Identity Provider) login flow - #3014

Merged
sfdctaka merged 3 commits into
forcedotcom:devfrom
sfdctaka:deprecate-idp-flow
Aug 29, 2026
Merged

sfdctaka merged 3 commits into
forcedotcom:devfrom
sfdctaka:deprecate-idp-flow

Conversation

@sfdctaka

Copy link
Copy Markdown
Contributor

Summary

Marks the IDP (Identity Provider) login flow 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 on the device log in without their own browser round-trip — is being retired. There is no drop-in replacement; apps should move to advanced (browser-based) authentication.

This PR only adds deprecation annotations. It does not remove the flow or change any runtime behavior — IDP keeps working in 14.0. App developers now get a compiler deprecation warning one major release ahead of removal.

What changed

  • @Deprecated(…) on the public IDP entry points:
    • SalesforceSDKManager: idpManager, spManager, isIDPLoginFlowEnabled, setIDPAppPackageName(String?), setAllowedSPApps(List<SPConfig>)
    • auth.idp.interfaces.IDPManager, SPManager, IDPAuthCodeActivity (incl. nested Status / StatusUpdateCallback)
    • auth.idp.SPConfig (data class + forCurrentApp()); the concrete IDPAuthCodeActivity, IDPReceiver, SPReceiver
    • ui.LoginActivity.onIDPLoginClick()
    • config.RuntimeConfig.ConfigKey.IDPAppPackageName (annotation + javadoc @deprecated)
  • The SDK's own internal usages carry scoped @Suppress("DEPRECATION") (function/class-level where the deprecated use is localized, @file:Suppress on the IDP-flow-specific files) so the SDK still builds warning-clean.

Notes

  • Mirrors the useWebServerAuthentication (OAuth user agent flow) deprecation landed the same release.
  • Annotation-only, no behavior change. idpManager / spManager keep private set; no backing fields introduced.
  • The RestExplorer sample app's live setIDPAppPackageName(...) call is intentionally left as-is — it demonstrates the still-shipping IDP feature, and the deprecation warning is the correct signal for a developer copying the sample.
  • Public API surface change — flagging for human review per the repo's escalation policy.
  • Companion iOS PR marks the equivalent iOS IDP surface deprecated.

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.
@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown
6 Warnings
⚠️ libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/idp/IDPAuthCodeActivity.kt#L119 - Using setJavaScriptEnabled can introduce XSS vulnerabilities into your application, review carefully
⚠️ libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/idp/SPAuthCodeHelper.kt#L88 - This method should only be accessed from tests or within private scope
⚠️ libs/SalesforceSDK/src/com/salesforce/androidsdk/ui/LoginActivity.kt#L1262 - Consider adding a <queries> declaration to your manifest when calling this method; see https://g.co/dev/packagevisibility for details
⚠️ libs/SalesforceSDK/src/com/salesforce/androidsdk/ui/LoginViewModel.kt#L360 - This method should only be accessed from tests or within private scope
⚠️ libs/SalesforceSDK/src/com/salesforce/androidsdk/ui/LoginViewModel.kt#L364 - This method should only be accessed from tests or within private scope
⚠️ libs/SalesforceSDK/src/com/salesforce/androidsdk/ui/LoginViewModel.kt#L368 - This method should only be accessed from tests or within private scope

Generated by 🚫 Danger

Comment thread libs/SalesforceSDK/src/com/salesforce/androidsdk/app/SalesforceSDKManager.kt Outdated
@sfdctaka
sfdctaka marked this pull request as ready for review August 28, 2026 00:01
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) <noreply@anthropic.com>
@sfdctaka
sfdctaka requested a review from brandonpage August 28, 2026 00:53

@wmathurin wmathurin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fully-qualified type names on the public idpManager/spManager property signatures are a bit noisy — e.g. com.salesforce.androidsdk.auth.idp.interfaces.IDPManager? in the declaration. The alternative would be to add the import and suppress at the file level with @file:Suppress("DEPRECATION"), which is the same pattern used in IDPManager.kt and SPManager.kt. Minor nit — not a blocker.

…uppress

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.
@sfdctaka
sfdctaka merged commit 2c4de31 into forcedotcom:dev Aug 29, 2026
5 of 6 checks passed
@sfdctaka
sfdctaka deleted the deprecate-idp-flow branch August 29, 2026 01:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants