mirror of
https://github.com/owncloud/android-library.git
synced 2026-08-12 00:42:58 +00:00
Use preemptive authentication except in server versions where it is not compatible with session tracking
This commit is contained in:
committed by
davigonz
parent
28d228b296
commit
d5e179d7a2
@@ -42,10 +42,10 @@ public class OwnCloudBasicCredentials implements OwnCloudCredentials {
|
||||
mAuthenticationPreemptive = true;
|
||||
}
|
||||
|
||||
public OwnCloudBasicCredentials(String username, String password, boolean sessionEnabled) {
|
||||
public OwnCloudBasicCredentials(String username, String password, boolean preemptiveMode) {
|
||||
mUsername = username != null ? username : "";
|
||||
mPassword = password != null ? password : "";
|
||||
mAuthenticationPreemptive = !sessionEnabled;
|
||||
mAuthenticationPreemptive = preemptiveMode;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -121,7 +121,7 @@ public class OwnCloudClientFactory {
|
||||
OwnCloudCredentialsFactory.newBasicCredentials(
|
||||
username,
|
||||
password,
|
||||
(version != null && version.isSessionMonitoringSupported())
|
||||
(version != null && version.isPreemptiveAuthenticationPreferred())
|
||||
)
|
||||
);
|
||||
|
||||
@@ -201,7 +201,7 @@ public class OwnCloudClientFactory {
|
||||
OwnCloudCredentialsFactory.newBasicCredentials(
|
||||
username,
|
||||
password,
|
||||
(version != null && version.isSessionMonitoringSupported())
|
||||
(version != null && version.isPreemptiveAuthenticationPreferred())
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -35,9 +35,9 @@ public class OwnCloudCredentialsFactory {
|
||||
}
|
||||
|
||||
public static OwnCloudCredentials newBasicCredentials(
|
||||
String username, String password, boolean sessionEnabled
|
||||
String username, String password, boolean preemptiveMode
|
||||
) {
|
||||
return new OwnCloudBasicCredentials(username, password, sessionEnabled);
|
||||
return new OwnCloudBasicCredentials(username, password, preemptiveMode);
|
||||
}
|
||||
|
||||
public static OwnCloudCredentials newBearerCredentials(String authToken) {
|
||||
|
||||
@@ -230,7 +230,7 @@ public class AccountUtils {
|
||||
credentials = OwnCloudCredentialsFactory.newBasicCredentials(
|
||||
username,
|
||||
password,
|
||||
version.isSessionMonitoringSupported()
|
||||
version.isPreemptiveAuthenticationPreferred()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user