Skip to content

Commit 48d39ee

Browse files
@W-20161958: [MSDK 13.1][Android] Cannot login GUS using Welcome endpoint (Correct Coverage For startBrowserCustomTabAuthorization)
1 parent 4ce2e8a commit 48d39ee

File tree

1 file changed

+34
-2
lines changed

1 file changed

+34
-2
lines changed

libs/SalesforceSDK/src/com/salesforce/androidsdk/ui/LoginActivity.kt

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ import android.provider.Settings.EXTRA_BIOMETRIC_AUTHENTICATORS_ALLOWED
5656
import android.security.KeyChain.choosePrivateKeyAlias
5757
import android.security.KeyChain.getCertificateChain
5858
import android.security.KeyChain.getPrivateKey
59+
import android.util.Log
5960
import android.view.KeyEvent
6061
import android.view.KeyEvent.KEYCODE_BACK
6162
import android.view.ViewGroup
@@ -1106,9 +1107,40 @@ open class LoginActivity : FragmentActivity() {
11061107
singleServerCustomTabActivity: Boolean = viewModel.singleServerCustomTabActivity,
11071108
) {
11081109
// Load the authorization URL in a browser custom tab if required and do nothing otherwise as the view model will load it in the web view.
1109-
// TODO: Coverage needed? ECJ20251210
1110-
if ((singleServerCustomTabActivity || isBrowserLoginEnabled) && !isUsingFrontDoorBridge /* UI front-door bridge bypasses the need for browser custom tab */) {
1110+
// TODO: Coverage needed - This one is challenging. ECJ20251210
1111+
// if (singleServerCustomTabActivity) {
1112+
// Log.i("WSC", "A.1")
1113+
// } else {
1114+
// Log.i("WSC", "A.2")
1115+
// }
1116+
// if (isBrowserLoginEnabled) {
1117+
// Log.i("WSC", "B.1")
1118+
// } else {
1119+
// Log.i("WSC", "B.2")
1120+
// }
1121+
//
1122+
// if (!singleServerCustomTabActivity && isBrowserLoginEnabled) {
1123+
// Log.i("WSC", "B.3 Right Side")
1124+
// }
1125+
1126+
val useBrowserLogin = (singleServerCustomTabActivity || isBrowserLoginEnabled)
1127+
1128+
// if (isUsingFrontDoorBridge) {
1129+
// Log.i("WSC", "C.1")
1130+
// } else {
1131+
// Log.i("WSC", "C.2")
1132+
// }
1133+
//
1134+
// if (useBrowserLogin && isBrowserLoginEnabled) {
1135+
// Log.i("WSC", "C.3 Right Side")
1136+
// }
1137+
1138+
val useBrowserLoginGuardAgainstFrontDoorBridge = useBrowserLogin && !isUsingFrontDoorBridge /* UI front-door bridge bypasses the need for browser custom tab */
1139+
1140+
if (useBrowserLoginGuardAgainstFrontDoorBridge) {
11111141
loadLoginPageInCustomTab(authorizationUrl, activityResultLauncher)
1142+
} else {
1143+
Log.i("WSC", "X")
11121144
}
11131145
}
11141146

0 commit comments

Comments
 (0)