Description
SalesforceSDKManager.setBrowserLoginEnabled() is called by fetchAuthenticationConfiguration() when the SDK detects a My Domain org with SSO enabled. This dynamically re-enables browser login even when the app has explicitly disabled it, causing a login loop for apps that must use WebView-only authentication.
In SDK 13.x, setBrowserLoginEnabled was made internal, so apps cannot call it from Java at all. But the SDK itself still calls it internally via fetchAuthenticationConfiguration(), overriding the app's intent.
Root Cause
In SalesforceSDKManager.kt, fetchAuthenticationConfiguration() calls setBrowserLoginEnabled(true, ...) when it detects the org supports browser-based auth. There is no mechanism for the app to indicate "never enable browser login regardless of server configuration."
Apps that block browser OAuth callbacks (e.g., because the Connected App doesn't support custom callback URL schemes) get stuck in a loop: the SDK enables browser login → Chrome Custom Tab opens → callback is blocked → login fails → repeat.
Steps to Reproduce
- Configure a Connected App that does not support browser-based OAuth callback URLs
- Block browser OAuth callbacks in a custom
LoginActivity subclass
- Log in to a My Domain org with SSO enabled
- SDK detects SSO, calls
fetchAuthenticationConfiguration(), enables browser login
- Next login attempt routes through Chrome Custom Tab instead of in-app WebView
- Callback is blocked → login loop
Expected Behavior
The SDK should provide a way to force-disable browser login so that fetchAuthenticationConfiguration() cannot re-enable it. For example:
var isBrowserLoginForcedOff = false
@Synchronized
fun setBrowserLoginEnabled(browserLoginEnabled: Boolean, shareBrowserSessionEnabled: Boolean) {
if (isBrowserLoginForcedOff && browserLoginEnabled) return
isBrowserLoginEnabled = browserLoginEnabled
// ...
}
Apps could then set SalesforceSDKManager.getInstance().isBrowserLoginForcedOff = true in MainApplication and be confident browser login stays disabled.
Additionally, setBrowserLoginEnabled should be public (not internal) so apps can manage this themselves. (Note: SDK 13.2.1 added "Login for Admin" which may have changed visibility — but the force-off mechanism is still missing.)
Affected Versions
- Confirmed on 13.2.0 and 13.2.1
- Affects any app using WebView-only authentication on SSO-enabled orgs
Environment
- Android SDK 13.2.0/13.2.1
- Connected App without browser OAuth callback URL support
- My Domain orgs with SSO/identity provider enabled
Description
SalesforceSDKManager.setBrowserLoginEnabled()is called byfetchAuthenticationConfiguration()when the SDK detects a My Domain org with SSO enabled. This dynamically re-enables browser login even when the app has explicitly disabled it, causing a login loop for apps that must use WebView-only authentication.In SDK 13.x,
setBrowserLoginEnabledwas madeinternal, so apps cannot call it from Java at all. But the SDK itself still calls it internally viafetchAuthenticationConfiguration(), overriding the app's intent.Root Cause
In
SalesforceSDKManager.kt,fetchAuthenticationConfiguration()callssetBrowserLoginEnabled(true, ...)when it detects the org supports browser-based auth. There is no mechanism for the app to indicate "never enable browser login regardless of server configuration."Apps that block browser OAuth callbacks (e.g., because the Connected App doesn't support custom callback URL schemes) get stuck in a loop: the SDK enables browser login → Chrome Custom Tab opens → callback is blocked → login fails → repeat.
Steps to Reproduce
LoginActivitysubclassfetchAuthenticationConfiguration(), enables browser loginExpected Behavior
The SDK should provide a way to force-disable browser login so that
fetchAuthenticationConfiguration()cannot re-enable it. For example:Apps could then set
SalesforceSDKManager.getInstance().isBrowserLoginForcedOff = trueinMainApplicationand be confident browser login stays disabled.Additionally,
setBrowserLoginEnabledshould bepublic(notinternal) so apps can manage this themselves. (Note: SDK 13.2.1 added "Login for Admin" which may have changed visibility — but the force-off mechanism is still missing.)Affected Versions
Environment