+\r
+ } else if (operation instanceof DetectAuthenticationMethodOperation) {\r
+ onDetectAutheticationFinish((DetectAuthenticationMethodOperation) operation, result);\r
+ }\r
+\r
+ }\r
+\r
+ private void onDetectAutheticationFinish(DetectAuthenticationMethodOperation operation, RemoteOperationResult result) {\r
+ // Read authentication method\r
+ if (result.getData().size() > 0) {\r
+ AuthenticationMethod authMethod = (AuthenticationMethod) result.getData().get(0);\r
+ String basic = AccountTypeUtils.getAuthTokenTypePass(MainApp.getAccountType());\r
+ String oAuth = AccountTypeUtils.getAuthTokenTypeAccessToken(MainApp.getAccountType());\r
+ String saml = AccountTypeUtils.getAuthTokenTypeSamlSessionCookie(MainApp.getAccountType());\r
+\r
+ if ( ( mAuthTokenType.equals(basic) && !authMethod.equals(AuthenticationMethod.BASIC_HTTP_AUTH) ) ||\r
+ ( mAuthTokenType.equals(oAuth) && !authMethod.equals(AuthenticationMethod.BEARER_TOKEN) ) || \r
+ ( mAuthTokenType.equals(saml) && !authMethod.equals(AuthenticationMethod.SAML_WEB_SSO) ) ) {\r
+\r
+ mOkButton.setEnabled(false);\r
+ mServerIsValid = false;\r
+ //show an alert message ( Server Status )\r
+ updateServerStatusIconNoRegularAuth();\r
+ showServerStatus();\r
+\r
+ } else {\r
+ mOkButton.setEnabled(true);\r
+\r
+ // Show server status\r
+ showServerStatus();\r
+ }\r
+\r