Search in sources :

Example 11 with OwnCloudCredentials

use of com.owncloud.android.lib.common.OwnCloudCredentials in project android by nextcloud.

the class AuthenticatorActivity method checkBasicAuthorization.

/**
 * Tests the credentials entered by the user performing a check of existence on the root folder of the ownCloud
 * server.
 */
private void checkBasicAuthorization(@Nullable String webViewUsername, @Nullable String webViewPassword) {
    // be gentle with the user
    IndeterminateProgressDialog dialog = IndeterminateProgressDialog.newInstance(R.string.auth_trying_to_login, true);
    FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
    ft.add(dialog, WAIT_DIALOG_TAG);
    ft.commitAllowingStateLoss();
    // validate credentials accessing the root folder
    OwnCloudCredentials credentials = OwnCloudCredentialsFactory.newBasicCredentials(webViewUsername, webViewPassword);
    accessRootFolder(credentials);
}
Also used : FragmentTransaction(androidx.fragment.app.FragmentTransaction) IndeterminateProgressDialog(com.owncloud.android.ui.dialog.IndeterminateProgressDialog) OwnCloudCredentials(com.owncloud.android.lib.common.OwnCloudCredentials)

Aggregations

OwnCloudCredentials (com.owncloud.android.lib.common.OwnCloudCredentials)11 OwnCloudClient (com.owncloud.android.lib.common.OwnCloudClient)5 AccountManager (android.accounts.AccountManager)3 Intent (android.content.Intent)3 OwnCloudAccount (com.owncloud.android.lib.common.OwnCloudAccount)3 Uri (android.net.Uri)2 RedirectionPath (com.owncloud.android.lib.common.network.RedirectionPath)2 RemoteOperationResult (com.owncloud.android.lib.common.operations.RemoteOperationResult)2 ExistenceCheckRemoteOperation (com.owncloud.android.lib.resources.files.ExistenceCheckRemoteOperation)2 IndeterminateProgressDialog (com.owncloud.android.ui.dialog.IndeterminateProgressDialog)2 LoadingDialog (com.owncloud.android.ui.dialog.LoadingDialog)2 Map (java.util.Map)2 Context (android.content.Context)1 FragmentTransaction (androidx.fragment.app.FragmentTransaction)1 UserAccountManager (com.nextcloud.client.account.UserAccountManager)1 NextcloudClient (com.nextcloud.common.NextcloudClient)1 AccountUtils (com.owncloud.android.authentication.AccountUtils)1 UserInfo (com.owncloud.android.lib.common.UserInfo)1 OwnCloudVersion (com.owncloud.android.lib.resources.status.OwnCloudVersion)1 GetRemoteUserInfoOperation (com.owncloud.android.lib.resources.users.GetRemoteUserInfoOperation)1