App adapted to replacement of OwnCloudClientMap for interface OwnCloudClientManager...
[pub/Android/ownCloud.git] / src / com / owncloud / android / operations / DetectAuthenticationMethodOperation.java
index 6bc8750..e8c0fd1 100644 (file)
@@ -94,7 +94,7 @@ public class DetectAuthenticationMethodOperation extends RemoteOperation {
         
         RemoteOperation operation = new ExistenceCheckRemoteOperation("", mContext, false);
         client.setWebdavUri(Uri.parse(mWebDavUrl));
-        client.setBasicCredentials("", "");
+        client.clearCredentials();
         client.setFollowRedirects(false);
         
         // try to access the root folder, following redirections but not SAML SSO redirections
@@ -126,6 +126,9 @@ public class DetectAuthenticationMethodOperation extends RemoteOperation {
         // else - fall back to UNKNOWN
         Log.d(TAG, "Authentication method found: " + authenticationMethodToString(authMethod));
         
+        if (!authMethod.equals(AuthenticationMethod.UNKNOWN)) {
+            result = new RemoteOperationResult(true, result.getHttpCode(), null);
+        }
         ArrayList<Object> data = new ArrayList<Object>();
         data.add(authMethod);
         result.setData(data);