Updated SSO

This commit is contained in:
Sylvain Berfini 2024-02-21 14:48:40 +01:00
parent 06074f0490
commit af1ee922ad
2 changed files with 5 additions and 7 deletions

View file

@ -78,7 +78,8 @@ class LandingViewModel @UiThread constructor() : ViewModel() {
redirectToDigestAuthEvent.postValue(Event(identityAddress.asStringUriOnly()))
} else {
Log.i("$TAG Address doesn't match default domain, using Single Sign On")
redirectToSingleSignOnEvent.postValue(Event(identityAddress.asStringUriOnly()))
// TODO FIXME: use username or full SIP address as login?
redirectToSingleSignOnEvent.postValue(Event(identityAddress.username.orEmpty()))
}
}
}

View file

@ -44,9 +44,8 @@ class SingleSignOnViewModel : ViewModel() {
companion object {
private const val TAG = "[Single Sign On ViewModel]"
private const val WELL_KNOWN = "https://sso.onhexagone.com//realms/ONHEXAGONE/.well-known/openid-configuration"
private const val CLIENT_ID = "account"
private const val SCOPE = "openid email profile"
private const val WELL_KNOWN = "https://sso.onhexagone.com/realms/ONHEXAGONE/.well-known/openid-configuration"
private const val CLIENT_ID = "linphone"
private const val REDIRECT_URI = "org.linphone:/openidcallback"
}
@ -124,9 +123,7 @@ class SingleSignOnViewModel : ViewModel() {
authRequestBuilder.setLoginHint(preFilledUser)
}
val authRequest = authRequestBuilder
.setScope(SCOPE)
.build()
val authRequest = authRequestBuilder.build()
authService = AuthorizationService(coreContext.context)
val authIntent = authService.getAuthorizationRequestIntent(authRequest)
startAuthIntentEvent.postValue(Event(authIntent))