mirror of
https://github.com/nextcloud/android.git
synced 2024-11-23 21:55:48 +03:00
Enable session support for all authentication methods in the app
This commit is contained in:
parent
1ee808f3a2
commit
02372fde24
1 changed files with 3 additions and 14 deletions
|
@ -36,26 +36,15 @@ public class MainApp extends Application {
|
||||||
|
|
||||||
private static final String AUTH_ON = "on";
|
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";
|
|
||||||
|
|
||||||
private static Context mContext;
|
private static Context mContext;
|
||||||
|
|
||||||
public void onCreate(){
|
public void onCreate(){
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
MainApp.mContext = getApplicationContext();
|
MainApp.mContext = getApplicationContext();
|
||||||
|
|
||||||
boolean isSamlAuth = AUTH_ON.equals(getString(R.string.auth_method_saml_web_sso));
|
// keep a single session per account handling session cookie in requests (& all the other cookies)
|
||||||
|
|
||||||
if (isSamlAuth) {
|
|
||||||
OwnCloudClientManagerFactory.setDefaultPolicy(Policy.SINGLE_SESSION_PER_ACCOUNT);
|
OwnCloudClientManagerFactory.setDefaultPolicy(Policy.SINGLE_SESSION_PER_ACCOUNT);
|
||||||
|
|
||||||
} else {
|
|
||||||
OwnCloudClientManagerFactory.setDefaultPolicy(Policy.ALWAYS_NEW_CLIENT);
|
|
||||||
}
|
|
||||||
|
|
||||||
// initialise thumbnails cache on background thread
|
// initialise thumbnails cache on background thread
|
||||||
new ThumbnailsCacheManager.InitDiskCacheTask().execute();
|
new ThumbnailsCacheManager.InitDiskCacheTask().execute();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue