From: David A. Velasco Date: Wed, 26 Mar 2014 07:34:39 +0000 (+0100) Subject: Fixed detection of authentication method in server with permanent redirection X-Git-Tag: oc-android-1.5.5^2 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/fb9f7797f4f44e08f2bc31ae9946d5c8a9ea9331?hp=-c Fixed detection of authentication method in server with permanent redirection --- fb9f7797f4f44e08f2bc31ae9946d5c8a9ea9331 diff --git a/src/com/owncloud/android/operations/DetectAuthenticationMethodOperation.java b/src/com/owncloud/android/operations/DetectAuthenticationMethodOperation.java index 560109f0..c6703161 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