diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/accounts/AccountUtils.java b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/accounts/AccountUtils.java
index a408de8e..47107653 100644
--- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/accounts/AccountUtils.java
+++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/accounts/AccountUtils.java
@@ -315,6 +315,11 @@ public class AccountUtils {
*/
public static final String KEY_DISPLAY_NAME = "oc_display_name";
+ /**
+ * OAuth2 user id
+ **/
+ public static final String KEY_USER_ID = "user_id";
+
/**
* OAuth2 refresh token
**/
diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/authentication/oauth/BearerCredentials.java b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/authentication/oauth/BearerCredentials.java
deleted file mode 100644
index 6f7e9a6e..00000000
--- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/authentication/oauth/BearerCredentials.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/* ownCloud Android Library is available under MIT license
- * Copyright (C) 2019 ownCloud GmbH.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- */
-
-package com.owncloud.android.lib.common.authentication.oauth;
-
-/**
- * @author David A. Velasco
- * @author Christian Schabesberger
- */
-public class BearerCredentials {
-
- public static final int HASH_SEED = 17;
- public static final int HASH_OFFSET = 37;
-
- private String mAccessToken;
-
- /**
- * The constructor with the bearer token
- *
- * @param token The bearer token
- */
- public BearerCredentials(String token) {
- mAccessToken = (token == null) ? "" : token;
- }
-
- /**
- * Returns the access token
- *
- * @return The access token
- */
- public String getAccessToken() {
- return mAccessToken;
- }
-
- /**
- * Get this object string.
- *
- * @return The access token
- */
- public String toString() {
- return mAccessToken;
- }
-
- /**
- * Does a hash of the access token.
- *
- * @return The hash code of the access token
- */
- public int hashCode() {
- return HASH_SEED * HASH_OFFSET + mAccessToken.hashCode();
- }
-
- /**
- * These credentials are assumed equal if accessToken is the same.
- *
- * @param o The other object to compare with.
- * @return 'True' if the object is equivalent.
- */
- public boolean equals(Object o) {
- if (o == null) {
- return false;
- }
- if (this == o) {
- return true;
- }
- if (this.getClass().equals(o.getClass())) {
- BearerCredentials that = (BearerCredentials) o;
- if (mAccessToken.equals(that.mAccessToken)) {
- return true;
- }
- }
- return false;
- }
-}
\ No newline at end of file
diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/authentication/oauth/OAuth2ClientConfiguration.java b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/authentication/oauth/OAuth2ClientConfiguration.java
deleted file mode 100644
index 24814167..00000000
--- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/authentication/oauth/OAuth2ClientConfiguration.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/* ownCloud Android Library is available under MIT license
- *
- * @author David A. Velasco
- * Copyright (C) 2017 ownCloud GmbH.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- */
-
-package com.owncloud.android.lib.common.authentication.oauth;
-
-public class OAuth2ClientConfiguration {
-
- private String mClientId;
-
- private String mClientSecret;
-
- private String mRedirectUri;
-
- public OAuth2ClientConfiguration(String clientId, String clientSecret, String redirectUri) {
- mClientId = (clientId == null) ? "" : clientId;
- mClientSecret = (clientSecret == null) ? "" : clientSecret;
- mRedirectUri = (redirectUri == null) ? "" : redirectUri;
- }
-
- public String getClientId() {
- return mClientId;
- }
-
- public void setClientId(String clientId) {
- mClientId = (clientId == null) ? "" : clientId;
- }
-
- public String getClientSecret() {
- return mClientSecret;
- }
-
- public void setClientSecret(String clientSecret) {
- mClientSecret = (clientSecret == null) ? "" : clientSecret;
- }
-
- public String getRedirectUri() {
- return mRedirectUri;
- }
-
- public void setRedirectUri(String redirectUri) {
- this.mRedirectUri = (redirectUri == null) ? "" : redirectUri;
- }
-}
diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/authentication/oauth/OAuth2Constants.java b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/authentication/oauth/OAuth2Constants.java
deleted file mode 100644
index 97dbfc41..00000000
--- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/authentication/oauth/OAuth2Constants.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/* ownCloud Android Library is available under MIT license
- *
- * @author David A. Velasco
- * Copyright (C) 2017 ownCloud GmbH.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- */
-
-package com.owncloud.android.lib.common.authentication.oauth;
-
-/**
- * Constant values for OAuth 2 protocol.
- *
- * Includes required and optional parameter NAMES used in the 'authorization code' grant type.
- */
-
-public class OAuth2Constants {
-
- /// Parameters to send to the Authorization Endpoint
- public static final String KEY_RESPONSE_TYPE = "response_type";
- public static final String KEY_REDIRECT_URI = "redirect_uri";
- public static final String KEY_CLIENT_ID = "client_id";
- public static final String KEY_SCOPE = "scope";
- public static final String KEY_STATE = "state";
-
- /// Additional parameters to send to the Token Endpoint
- public static final String KEY_GRANT_TYPE = "grant_type";
- public static final String KEY_CODE = "code";
-
- // Used to get the Access Token using Refresh Token
- public static final String OAUTH2_REFRESH_TOKEN_GRANT_TYPE = "refresh_token";
-
- /// Parameters received in an OK response from the Token Endpoint
- public static final String KEY_ACCESS_TOKEN = "access_token";
- public static final String KEY_TOKEN_TYPE = "token_type";
- public static final String KEY_EXPIRES_IN = "expires_in";
- public static final String KEY_REFRESH_TOKEN = "refresh_token";
-
- /// Parameters in an ERROR response
- public static final String KEY_ERROR = "error";
- public static final String KEY_ERROR_DESCRIPTION = "error_description";
- public static final String KEY_ERROR_URI = "error_uri";
- public static final String VALUE_ERROR_ACCESS_DENIED = "access_denied";
-
- /// Extra not standard
- public static final String KEY_USER_ID = "user_id";
-
- /// Depends on oauth2 grant type
- public static final String OAUTH2_RESPONSE_TYPE_CODE = "code";
-}
diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/authentication/oauth/OAuth2GetAccessTokenOperation.java b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/authentication/oauth/OAuth2GetAccessTokenOperation.java
deleted file mode 100644
index c5273215..00000000
--- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/authentication/oauth/OAuth2GetAccessTokenOperation.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/* ownCloud Android Library is available under MIT license
- *
- * @author David A. Velasco
- * @author Christian Schabesberger
- * Copyright (C) 2019 ownCloud GmbH.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- */
-
-package com.owncloud.android.lib.common.authentication.oauth;
-
-import android.net.Uri;
-
-import com.owncloud.android.lib.common.OwnCloudClient;
-import com.owncloud.android.lib.common.authentication.OwnCloudBasicCredentials;
-import com.owncloud.android.lib.common.authentication.OwnCloudCredentials;
-import com.owncloud.android.lib.common.http.methods.nonwebdav.PostMethod;
-import com.owncloud.android.lib.common.operations.RemoteOperation;
-import com.owncloud.android.lib.common.operations.RemoteOperationResult;
-import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
-import okhttp3.MultipartBody;
-import okhttp3.RequestBody;
-import org.json.JSONObject;
-
-import java.net.URL;
-import java.util.Map;
-
-public class OAuth2GetAccessTokenOperation extends RemoteOperation