You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: libs/SalesforceSDK/src/com/salesforce/androidsdk/ui/LoginViewModel.kt
+65-10Lines changed: 65 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -121,10 +121,10 @@ open class LoginViewModel(val bootConfig: BootConfig) : ViewModel() {
121
121
/** The login server that has been selected by the login server manager, has an authentication configuration and is ready for use */
122
122
val selectedServer =MediatorLiveData<String>()
123
123
124
-
/** The selected login server's OAuth authorization URL */
124
+
/** The selected login server's OAuth authorization URL for use in the web view when browser-based authentication is inactive */
125
125
val loginUrl =MediatorLiveData<String>()
126
126
127
-
/** The URL to be displayed in the activity's browser custom tab activity. This is used for browser-based authentication requires loading the OAuth authorization URL outside the app's web view*/
127
+
/** The selected login server's OAuth authorization URL for use in the external browser custom tab when browser-based authentication is active. This provides the login flow with the requirements for advanced authentication, such as client certificates*/
128
128
val browserCustomTabUrl =MediatorLiveData<String>()
129
129
130
130
var showServerPicker = mutableStateOf(false)
@@ -136,12 +136,12 @@ open class LoginViewModel(val bootConfig: BootConfig) : ViewModel() {
/** The login server that is pending authentication configuration before becoming the selected login server */
139
+
/** The login server that has been selected by the login server manager and is pending authentication configuration before becoming the selected login server */
// When authorization via a single-server, custom tab activity is requested skip fetching the authorization configuration and immediately set the selected login server to generate the OAuth authorization URL.
334
334
if (singleServerCustomTabActivity) {
@@ -415,6 +415,14 @@ open class LoginViewModel(val bootConfig: BootConfig) : ViewModel() {
415
415
}
416
416
}
417
417
418
+
/**
419
+
* Generates an OAuth authorization URL for the provided server.
420
+
* @param server The login server URL
421
+
* @param sdkManager The Salesforce SDK manager. This parameter is intended
422
+
* for testing purposes only. Defaults to the shared instance
423
+
* @param scope The Coroutine scope. This parameter is intended for testing
424
+
* purposes only. Defaults to the IO scope
425
+
*/
418
426
@VisibleForTesting
419
427
internalsuspendfungetAuthorizationUrl(
420
428
server:String,
@@ -505,10 +513,31 @@ open class LoginViewModel(val bootConfig: BootConfig) : ViewModel() {
505
513
* @return Boolean true if the provided pending login server URL is a
506
514
* switch from Salesforce Welcome Discovery back to the default log in,
0 commit comments