* @author David A. Velasco
*/
public class MainApp extends Application {
-
+
+ private static final String AUTH_ON = "on";
+
+ @SuppressWarnings("unused")
private static final String POLICY_SINGLE_SESSION_PER_ACCOUNT = "single session per account";
@SuppressWarnings("unused")
private static final String POLICY_ALWAYS_NEW_CLIENT = "always new client";
super.onCreate();
MainApp.mContext = getApplicationContext();
- String clientPolicy = getString(R.string.client_creation_policy);
- if (clientPolicy != null &&
- POLICY_SINGLE_SESSION_PER_ACCOUNT.equals(clientPolicy.toLowerCase())) {
-
+ boolean isSamlAuth = AUTH_ON.equals(getString(R.string.auth_method_saml_web_sso));
+
+ if (isSamlAuth) {
OwnCloudClientManagerFactory.setDefaultPolicy(Policy.SINGLE_SESSION_PER_ACCOUNT);
} else {
/// test credentials accessing the root folder\r
String remotePath ="";\r
boolean successIfAbsent = false;\r
- boolean followRedirects = true;\r
startExistenceCheckRemoteOperation(\r
- remotePath, this, successIfAbsent, username, password, followRedirects);\r
+ remotePath, this, successIfAbsent, username, password);\r
\r
}\r
\r
private void startExistenceCheckRemoteOperation(\r
String remotePath, Context context, boolean successIfAbsent,\r
- String username, String password, boolean followRedirects) {\r
+ String username, String password) {\r
Intent existenceCheckIntent = new Intent();\r
existenceCheckIntent.setAction(OperationsService.ACTION_EXISTENCE_CHECK);\r
existenceCheckIntent.putExtra(OperationsService.EXTRA_SERVER_URL, mServerInfo.mBaseUrl);\r
existenceCheckIntent.putExtra(OperationsService.EXTRA_USERNAME, username);\r
existenceCheckIntent.putExtra(OperationsService.EXTRA_PASSWORD, password);\r
existenceCheckIntent.putExtra(OperationsService.EXTRA_AUTH_TOKEN, mAuthToken);\r
- existenceCheckIntent.putExtra(OperationsService.EXTRA_FOLLOW_REDIRECTS, followRedirects);\r
\r
if (mOperationsServiceBinder != null) {\r
//Log_OC.wtf(TAG, "starting existenceCheckRemoteOperation..." );\r
/// test credentials accessing the root folder\r
String remotePath ="";\r
boolean successIfAbsent = false;\r
- boolean followRedirections = false;\r
startExistenceCheckRemoteOperation(\r
- remotePath, this, successIfAbsent, "", "", followRedirections);\r
+ remotePath, this, successIfAbsent, "", "");\r
\r
}\r
\r
\r
String remotePath ="";\r
boolean successIfAbsent = false;\r
- boolean followRedirects = true;\r
startExistenceCheckRemoteOperation(\r
- remotePath, this, successIfAbsent, "", "", followRedirects);\r
+ remotePath, this, successIfAbsent, "", "");\r
\r
} else {\r
updateAuthStatusIconAndText(result);\r
getUserNameIntent.setAction(OperationsService.ACTION_GET_USER_NAME);\r
getUserNameIntent.putExtra(OperationsService.EXTRA_SERVER_URL, mServerInfo.mBaseUrl);\r
getUserNameIntent.putExtra(OperationsService.EXTRA_COOKIE, sessionCookie);\r
- getUserNameIntent.putExtra(OperationsService.EXTRA_FOLLOW_REDIRECTS, followRedirects);\r
\r
if (mOperationsServiceBinder != null) {\r
//Log_OC.wtf(TAG, "starting getRemoteUserNameOperation..." );\r
public static final String EXTRA_USERNAME = "USERNAME";
public static final String EXTRA_PASSWORD = "PASSWORD";
public static final String EXTRA_AUTH_TOKEN = "AUTH_TOKEN";
- public static final String EXTRA_FOLLOW_REDIRECTS = "FOLLOW_REDIRECTS";
public static final String EXTRA_COOKIE = "COOKIE";
public static final String ACTION_CREATE_SHARE = "CREATE_SHARE";
public String mUsername = null;
public String mPassword = null;
public String mAuthToken = null;
- public boolean mFollowRedirects = true;
public String mCookie = null;
public Target(Account account, Uri serverUrl, String username, String password, String authToken,
- boolean followRedirects, String cookie) {
+ String cookie) {
mAccount = account;
mServerUrl = serverUrl;
mUsername = username;
mPassword = password;
mAuthToken = authToken;
- mFollowRedirects = followRedirects;
mCookie = cookie;
}
}
String username = operationIntent.getStringExtra(EXTRA_USERNAME);
String password = operationIntent.getStringExtra(EXTRA_PASSWORD);
String authToken = operationIntent.getStringExtra(EXTRA_AUTH_TOKEN);
- boolean followRedirects = operationIntent.getBooleanExtra(EXTRA_FOLLOW_REDIRECTS, true);
String cookie = operationIntent.getStringExtra(EXTRA_COOKIE);
target = new Target(
account,
username,
password,
authToken,
- followRedirects,
cookie
);
mLastTarget.mServerUrl, credentials);
mOwnCloudClient = OwnCloudClientManagerFactory.getDefaultSingleton().
getClientFor(ocAccount, this);
- mOwnCloudClient.setFollowRedirects(mLastTarget.mFollowRedirects);
mStorageManager = null;
}
}