From fb9f7797f4f44e08f2bc31ae9946d5c8a9ea9331 Mon Sep 17 00:00:00 2001 From: "David A. Velasco" Date: Wed, 26 Mar 2014 08:34:39 +0100 Subject: [PATCH] Fixed detection of authentication method in server with permanent redirection --- .../operations/DetectAuthenticationMethodOperation.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/com/owncloud/android/operations/DetectAuthenticationMethodOperation.java b/src/com/owncloud/android/operations/DetectAuthenticationMethodOperation.java index 560109f062..c67031618f 100644 --- a/src/com/owncloud/android/operations/DetectAuthenticationMethodOperation.java +++ b/src/com/owncloud/android/operations/DetectAuthenticationMethodOperation.java @@ -95,9 +95,11 @@ public class DetectAuthenticationMethodOperation extends RemoteOperation { // try to access the root folder, following redirections but not SAML SSO redirections result = operation.execute(client); - while (result.isTemporalRedirection() && !result.isIdPRedirection()) { + String redirectedLocation = result.getRedirectedLocation(); + while (redirectedLocation != null && redirectedLocation.length() > 0 && !result.isIdPRedirection()) { client.setWebdavUri(Uri.parse(result.getRedirectedLocation())); result = operation.execute(client); + redirectedLocation = result.getRedirectedLocation(); } // analyze response