import com.owncloud.android.MainApp;\r
import com.owncloud.android.R;\r
import com.owncloud.android.authentication.SsoWebViewClient.SsoWebViewClientListener;\r
+import com.owncloud.android.lib.common.OwnCloudAccount;\r
+import com.owncloud.android.lib.common.OwnCloudClientManagerFactory;\r
+import com.owncloud.android.lib.common.OwnCloudCredentialsFactory;\r
import com.owncloud.android.lib.common.accounts.AccountTypeUtils;\r
import com.owncloud.android.lib.common.accounts.AccountUtils.Constants;\r
import com.owncloud.android.operations.DetectAuthenticationMethodOperation.AuthenticationMethod;\r
Intent getServerInfoIntent = new Intent();\r
getServerInfoIntent.setAction(OperationsService.ACTION_GET_SERVER_INFO);\r
getServerInfoIntent.putExtra(OperationsService.EXTRA_SERVER_URL, uri);\r
- getServerInfoIntent.putExtra(OperationsService.EXTRA_AUTH_TOKEN_TYPE, mAuthTokenType);\r
if (mOperationsServiceBinder != null) {\r
- //Log_OC.wtf(TAG, "checking server..." );\r
mWaitingForOpId = mOperationsServiceBinder.newOperation(getServerInfoIntent);\r
} else {\r
Log_OC.wtf(TAG, "Server check tried with OperationService unbound!" );\r
IndeterminateProgressDialog.newInstance(R.string.auth_trying_to_login, true);\r
dialog.show(getSupportFragmentManager(), WAIT_DIALOG_TAG);\r
\r
- /// test credentials accessing the root folder\r
- String remotePath ="";\r
- boolean successIfAbsent = false;\r
- startExistenceCheckRemoteOperation(\r
- remotePath, this, successIfAbsent, username, password);\r
+ /// validate credentials accessing the root folder\r
+ accessRootFolderRemoteOperation(username, password);\r
\r
}\r
\r
- private void startExistenceCheckRemoteOperation(\r
- String remotePath, Context context, boolean successIfAbsent,\r
- String username, String password) {\r
+ private void accessRootFolderRemoteOperation(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_REMOTE_PATH, remotePath);\r
- existenceCheckIntent.putExtra(OperationsService.EXTRA_SUCCESS_IF_ABSENT, successIfAbsent);\r
+ existenceCheckIntent.putExtra(OperationsService.EXTRA_REMOTE_PATH, "/");\r
existenceCheckIntent.putExtra(OperationsService.EXTRA_USERNAME, username);\r
existenceCheckIntent.putExtra(OperationsService.EXTRA_PASSWORD, password);\r
existenceCheckIntent.putExtra(OperationsService.EXTRA_AUTH_TOKEN, mAuthToken);\r
IndeterminateProgressDialog.newInstance(R.string.auth_trying_to_login, true);\r
dialog.show(getSupportFragmentManager(), WAIT_DIALOG_TAG);\r
\r
- /// test credentials accessing the root folder\r
- String remotePath ="";\r
- boolean successIfAbsent = false;\r
- startExistenceCheckRemoteOperation(\r
- remotePath, this, successIfAbsent, "", "");\r
+ /// validate credentials accessing the root folder\r
+ accessRootFolderRemoteOperation("", "");\r
\r
}\r
\r
\r
if (!mUsernameInput.getText().toString().equals(username)) {\r
// fail - not a new account, but an existing one; disallow\r
- result = new RemoteOperationResult(ResultCode.ACCOUNT_NOT_THE_SAME); \r
+ result = new RemoteOperationResult(ResultCode.ACCOUNT_NOT_THE_SAME);\r
+ /*\r
+ OwnCloudClientManagerFactory.getDefaultSingleton().removeClientFor(\r
+ new OwnCloudAccount(\r
+ Uri.parse(mServerInfo.mBaseUrl),\r
+ OwnCloudCredentialsFactory.newSamlSsoCredentials(mAuthToken))\r
+ );\r
+ */\r
+ mAuthToken = "";\r
updateAuthStatusIconAndText(result);\r
showAuthStatus();\r
Log_OC.d(TAG, result.getLogMessage());\r
//mAuthToken = ((OAuth2GetAccessToken)operation).getResultTokenMap().get(OAuth2Constants.KEY_ACCESS_TOKEN);\r
Log_OC.d(TAG, "Got ACCESS TOKEN: " + mAuthToken);\r
\r
- String remotePath ="";\r
- boolean successIfAbsent = false;\r
- startExistenceCheckRemoteOperation(\r
- remotePath, this, successIfAbsent, "", "");\r
+ accessRootFolderRemoteOperation("", "");\r
\r
} else {\r
updateAuthStatusIconAndText(result);\r