mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-26 00:08:11 +00:00
Added a setting to choose if we want to use the SIP address username as SSO username
This commit is contained in:
parent
505fa3b66c
commit
247788c64c
2 changed files with 7 additions and 1 deletions
|
|
@ -216,6 +216,10 @@ class CorePreferences @UiThread constructor(private val context: Context) {
|
|||
val hideAssistantThirdPartySipAccount: Boolean
|
||||
get() = config.getBool("ui", "assistant_hide_third_party_account", false)
|
||||
|
||||
@get:WorkerThread
|
||||
val useUsernameAsSingleSignOnLoginHint: Boolean
|
||||
get() = config.getBool("ui", "use_username_as_sso_login_hint", true)
|
||||
|
||||
/* Paths */
|
||||
|
||||
@get:WorkerThread
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ import net.openid.appauth.AuthorizationServiceConfiguration
|
|||
import net.openid.appauth.ResponseTypeValues
|
||||
import org.json.JSONObject
|
||||
import org.linphone.LinphoneApplication.Companion.coreContext
|
||||
import org.linphone.LinphoneApplication.Companion.corePreferences
|
||||
import org.linphone.core.Factory
|
||||
import org.linphone.core.tools.Log
|
||||
import org.linphone.ui.GenericViewModel
|
||||
|
|
@ -136,7 +137,8 @@ class SingleSignOnViewModel : GenericViewModel() {
|
|||
// an invalid grant error with description "Session not active"
|
||||
authRequestBuilder.setScopes("offline_access")
|
||||
|
||||
if (username.isNotEmpty()) {
|
||||
if (username.isNotEmpty() && corePreferences.useUsernameAsSingleSignOnLoginHint) {
|
||||
Log.i("$TAG Using username [$username] as login hint")
|
||||
authRequestBuilder.setLoginHint(username)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue