mirror of
https://github.com/owncloud/android-library.git
synced 2025-06-07 16:06:08 +00:00
Moved credentials charset constant out of interface, so that it's correctly initialized
This commit is contained in:
parent
3f89bf20a4
commit
0666f08ea6
@ -47,7 +47,7 @@ public class OwnCloudBasicCredentials implements OwnCloudCredentials {
|
|||||||
client.getParams().setParameter(AuthPolicy.AUTH_SCHEME_PRIORITY, authPrefs);
|
client.getParams().setParameter(AuthPolicy.AUTH_SCHEME_PRIORITY, authPrefs);
|
||||||
|
|
||||||
client.getParams().setAuthenticationPreemptive(true);
|
client.getParams().setAuthenticationPreemptive(true);
|
||||||
client.getParams().setCredentialCharset(CREDENTIAL_CHARSET);
|
client.getParams().setCredentialCharset(OwnCloudCredentialsFactory.CREDENTIAL_CHARSET);
|
||||||
client.getState().setCredentials(
|
client.getState().setCredentials(
|
||||||
AuthScope.ANY,
|
AuthScope.ANY,
|
||||||
new UsernamePasswordCredentials(mUsername, mPassword)
|
new UsernamePasswordCredentials(mUsername, mPassword)
|
||||||
|
@ -49,7 +49,7 @@ public class OwnCloudBearerCredentials implements OwnCloudCredentials {
|
|||||||
client.getParams().setParameter(AuthPolicy.AUTH_SCHEME_PRIORITY, authPrefs);
|
client.getParams().setParameter(AuthPolicy.AUTH_SCHEME_PRIORITY, authPrefs);
|
||||||
|
|
||||||
client.getParams().setAuthenticationPreemptive(true);
|
client.getParams().setAuthenticationPreemptive(true);
|
||||||
client.getParams().setCredentialCharset(CREDENTIAL_CHARSET);
|
client.getParams().setCredentialCharset(OwnCloudCredentialsFactory.CREDENTIAL_CHARSET);
|
||||||
client.getState().setCredentials(
|
client.getState().setCredentials(
|
||||||
AuthScope.ANY,
|
AuthScope.ANY,
|
||||||
new BearerCredentials(mAccessToken)
|
new BearerCredentials(mAccessToken)
|
||||||
|
@ -25,7 +25,6 @@
|
|||||||
package com.owncloud.android.lib.common;
|
package com.owncloud.android.lib.common;
|
||||||
|
|
||||||
public interface OwnCloudCredentials {
|
public interface OwnCloudCredentials {
|
||||||
public static final String CREDENTIAL_CHARSET = "UTF-8";
|
|
||||||
|
|
||||||
public void applyTo(OwnCloudClient ownCloudClient);
|
public void applyTo(OwnCloudClient ownCloudClient);
|
||||||
|
|
||||||
|
@ -26,6 +26,8 @@ package com.owncloud.android.lib.common;
|
|||||||
|
|
||||||
public class OwnCloudCredentialsFactory {
|
public class OwnCloudCredentialsFactory {
|
||||||
|
|
||||||
|
public static final String CREDENTIAL_CHARSET = "UTF-8";
|
||||||
|
|
||||||
private static OwnCloudAnonymousCredentials sAnonymousCredentials;
|
private static OwnCloudAnonymousCredentials sAnonymousCredentials;
|
||||||
|
|
||||||
public static OwnCloudCredentials newBasicCredentials(String username, String password) {
|
public static OwnCloudCredentials newBasicCredentials(String username, String password) {
|
||||||
|
@ -41,7 +41,7 @@ public class OwnCloudSamlSsoCredentials implements OwnCloudCredentials {
|
|||||||
@Override
|
@Override
|
||||||
public void applyTo(OwnCloudClient client) {
|
public void applyTo(OwnCloudClient client) {
|
||||||
client.getParams().setAuthenticationPreemptive(false);
|
client.getParams().setAuthenticationPreemptive(false);
|
||||||
client.getParams().setCredentialCharset(CREDENTIAL_CHARSET);
|
client.getParams().setCredentialCharset(OwnCloudCredentialsFactory.CREDENTIAL_CHARSET);
|
||||||
client.getParams().setCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY);
|
client.getParams().setCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY);
|
||||||
client.setFollowRedirects(false);
|
client.setFollowRedirects(false);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user