mdm only needs to provide server address

fallback to normal login

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
tobiasKaminsky 2024-06-12 11:57:11 +02:00 committed by Alper Öztürk
parent 08afce2e73
commit af9a63a29e
2 changed files with 10 additions and 6 deletions

View File

@ -43,4 +43,4 @@
</inspection_tool> </inspection_tool>
<inspection_tool class="RedundantSemicolon" enabled="true" level="ERROR" enabled_by_default="true" /> <inspection_tool class="RedundantSemicolon" enabled="true" level="ERROR" enabled_by_default="true" />
</profile> </profile>
</component> </component>

View File

@ -317,22 +317,26 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
mIsFirstAuthAttempt = savedInstanceState.getBoolean(KEY_AUTH_IS_FIRST_ATTEMPT_TAG); mIsFirstAuthAttempt = savedInstanceState.getBoolean(KEY_AUTH_IS_FIRST_ATTEMPT_TAG);
} }
boolean webViewLoginMethod; boolean webViewLoginMethod = false;
String webloginUrl = null; String webloginUrl = null;
if (MainApp.isClientBrandedPlus()) { if (MainApp.isClientBrandedPlus()) {
RestrictionsManager restrictionsManager = (RestrictionsManager) getSystemService(Context.RESTRICTIONS_SERVICE); RestrictionsManager restrictionsManager = (RestrictionsManager) getSystemService(Context.RESTRICTIONS_SERVICE);
AppConfigManager appConfigManager = new AppConfigManager(this, restrictionsManager.getApplicationRestrictions()); AppConfigManager appConfigManager = new AppConfigManager(this, restrictionsManager.getApplicationRestrictions());
webloginUrl = appConfigManager.getBaseUrl(MainApp.isClientBrandedPlus());
if (!TextUtils.isEmpty(appConfigManager.getBaseUrl(MainApp.isClientBrandedPlus()))) {
webloginUrl = appConfigManager.getBaseUrl(MainApp.isClientBrandedPlus()) + WEB_LOGIN;
}
} }
if (webloginUrl != null) { if (!TextUtils.isEmpty(webloginUrl)) {
webViewLoginMethod = true; webViewLoginMethod = true;
} else if (getIntent().getBooleanExtra(EXTRA_USE_PROVIDER_AS_WEBLOGIN, false)) { } else if (getIntent().getBooleanExtra(EXTRA_USE_PROVIDER_AS_WEBLOGIN, false)) {
webViewLoginMethod = true; webViewLoginMethod = true;
webloginUrl = getString(R.string.provider_registration_server); webloginUrl = getString(R.string.provider_registration_server);
} else { } else if (!TextUtils.isEmpty(getResources().getString(R.string.webview_login_url))) {
webViewLoginMethod = !TextUtils.isEmpty(getResources().getString(R.string.webview_login_url)); webViewLoginMethod = true;
webloginUrl = getResources().getString(R.string.webview_login_url);
showWebViewLoginUrl = getResources().getBoolean(R.bool.show_server_url_input); showWebViewLoginUrl = getResources().getBoolean(R.bool.show_server_url_input);
} }