diff --git a/mobile/android/base/sync/net/BaseResource.java b/mobile/android/base/sync/net/BaseResource.java index b861b9a4d0f..f2d97edb889 100644 --- a/mobile/android/base/sync/net/BaseResource.java +++ b/mobile/android/base/sync/net/BaseResource.java @@ -117,8 +117,6 @@ public class BaseResource implements Resource { * @param credentials a string, "user:pass". */ private static void applyCredentials(String credentials, HttpUriRequest request, HttpContext context) { - addAuthCacheToContext(request, context); - Credentials creds = new UsernamePasswordCredentials(credentials); Header header = BasicScheme.authenticate(creds, "US-ASCII", false); request.addHeader(header); @@ -144,6 +142,8 @@ public class BaseResource implements Resource { BaseResource.applyCredentials(credentials, request, context); } + addAuthCacheToContext(request, context); + HttpParams params = client.getParams(); HttpConnectionParams.setConnectionTimeout(params, delegate.connectionTimeout()); HttpConnectionParams.setSoTimeout(params, delegate.socketTimeout());