In Mobile SDK 13.0, we redesigned the login experience on Android. The redesign features a modernized architecture that uses Jetpack Compose and Model-View-ViewModel (MVVM).
Starting in 13.0, you can customize your app’s login screen in LoginViewModel without overriding LoginActivity. If your app makes extensive customizations to LoginActivity, see Breaking Code Changes to adapt your work.
In our redesign of the Android login experience, we made these breaking code changes. The values and functions from these classes have been moved, updated, or removed.
We removed OAuthWebviewHelper in 13.0.
val authorizationDisplayTypemoved toLoginViewModel.val loginUrlmoved toLoginViewModel.fun clearCookies()moved toLoginViewModel.inner class AuthWebViewClient : WebViewClient()moved toLoginActivity.fun buildAccountName(username: String?, instanceServer: String?)moved toLoginViewModel.
val oAuthClientId/getOAuthClientId()was updated. Set or overridevar clientIdinLoginViewModel.fun makeWebChromeClient()was updated. Overrideval webChromeClientinLoginActivity.fun makeWebViewClient()was updated. Overrideval webViewClientinLoginActivity.fun onAuthFlowComplete(tr: OAuth2.TokenEndpointResponse?, nativeLogin: Boolean)was updated. Use theonAuthFlowSuccess(userAccount: UserAccount)function inLoginActivity.
fun getAuthorizationUrl(useWebServerAuthentication: Boolean, useHybridAuthentication: Boolean)
We removed OAuthWebviewHelperEvents in 13.0.
fun loadingLoginPage(loginUrl: String)was updated. Observe changes in the view model’sloginUrlorselectedServer.fun finish(userAccount: UserAccount?)was updated. UseonAuthFlowSuccess(userAccount: UserAccount)inLoginActivityinstead.
fun onAccountAuthenticatorResult(authResult: Bundle)
fun onClearCookiesClick(v: View?)is now handled in Compose. OverrideclearCookies()in the view model instead.findViewById<WebView>was updated. Modify or overrideval webView: WebViewinLoginActivity.actionBar/supportActionBarwas updated. Customize values likevar titleText: String?andvar topBarColor: Color?in the view model.
fun getOAuthWebviewHelper(...)fun onPickServerClick(v: View?)