// refresh button enabled\r
outState.putBoolean(KEY_REFRESH_BUTTON_ENABLED, (mRefreshButton.getVisibility() == View.VISIBLE));\r
\r
-\r
}\r
\r
\r
}\r
}\r
\r
-\r
/**\r
* The redirection triggered by the OAuth authentication server as response to the GET AUTHORIZATION, and \r
* deferred in {@link #onNewIntent(Intent)}, is processed here.\r
private void detectAuthorizationMethod() {\r
\r
Log_OC.d(TAG, "Trying empty authorization to detect authentication method");\r
-\r
+ \r
+ String webdav_path = AccountUtils.getWebdavPath(mDiscoveredVersion, mAuthTokenType);\r
+ \r
/// test credentials \r
- Intent service = new Intent(this, OperationsService.class);\r
+ Intent service = new Intent(this, OperationsService.class); \r
service.setAction(OperationsService.ACTION_DETECT_AUTHENTICATION_METHOD);\r
service.putExtra(OperationsService.EXTRA_SERVER_URL, mHostBaseUrl);\r
+ service.putExtra(OperationsService.EXTRA_WEBDAV_PATH, webdav_path);\r
startService(service);\r
}\r
\r
}
private Context mContext;
+ private String mWebDavUrl;
/**
* Constructor
*
* @param context Android context of the caller.
+ * @param webdavUrl
*/
- public DetectAuthenticationMethodOperation(Context context) {
+ public DetectAuthenticationMethodOperation(Context context, String webdavUrl) {
mContext = context;
+ mWebDavUrl = webdavUrl;
}
AuthenticationMethod authMethod = AuthenticationMethod.UNKNOWN;
RemoteOperation operation = new ExistenceCheckRemoteOperation("", mContext, false);
+ client.setWebdavUri(Uri.parse(mWebDavUrl));
client.setBasicCredentials("", "");
client.setFollowRedirects(false);
public static final String EXTRA_REMOTE_PATH = "REMOTE_PATH";
public static final String EXTRA_SEND_INTENT = "SEND_INTENT";
public static final String EXTRA_RESULT = "RESULT";
+ public static final String EXTRA_WEBDAV_PATH = "WEBDAV_PATH";
public static final String ACTION_CREATE_SHARE = "CREATE_SHARE";
public static final String ACTION_UNSHARE = "UNSHARE";
operation = new UnshareLinkOperation(remotePath, this.getApplicationContext());
}
} else if (action.equals(ACTION_DETECT_AUTHENTICATION_METHOD)) { // Detect Authentication Method
- operation = new DetectAuthenticationMethodOperation(this.getApplicationContext());
+ String webdav_url = serverUrl + intent.getStringExtra(EXTRA_WEBDAV_PATH);
+ operation = new DetectAuthenticationMethodOperation(this.getApplicationContext(), webdav_url);
} else {
// nothing we are going to handle