diff --git a/owncloudApp/src/main/java/com/owncloud/android/presentation/authentication/oauth/OAuthUtils.kt b/owncloudApp/src/main/java/com/owncloud/android/presentation/authentication/oauth/OAuthUtils.kt index 1e861a0e7b7..e71ee4204f0 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/presentation/authentication/oauth/OAuthUtils.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/presentation/authentication/oauth/OAuthUtils.kt @@ -2,7 +2,9 @@ * ownCloud Android client application * * @author David González Verdugo - * Copyright (C) 2020 ownCloud GmbH + * @author Juan Carlos Garrote Gascón + * + * Copyright (C) 2024 ownCloud GmbH * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -27,12 +29,13 @@ import com.owncloud.android.R import com.owncloud.android.data.authentication.QUERY_PARAMETER_CLIENT_ID import com.owncloud.android.data.authentication.QUERY_PARAMETER_CODE_CHALLENGE import com.owncloud.android.data.authentication.QUERY_PARAMETER_CODE_CHALLENGE_METHOD +import com.owncloud.android.data.authentication.QUERY_PARAMETER_LOGIN_HINT import com.owncloud.android.data.authentication.QUERY_PARAMETER_PROMPT import com.owncloud.android.data.authentication.QUERY_PARAMETER_REDIRECT_URI import com.owncloud.android.data.authentication.QUERY_PARAMETER_RESPONSE_TYPE import com.owncloud.android.data.authentication.QUERY_PARAMETER_SCOPE import com.owncloud.android.data.authentication.QUERY_PARAMETER_STATE -import com.owncloud.android.data.authentication.QUERY_PARAMETER_USERNAME +import com.owncloud.android.data.authentication.QUERY_PARAMETER_USER import com.owncloud.android.domain.authentication.oauth.model.ClientRegistrationRequest import java.net.URLEncoder import java.security.MessageDigest @@ -113,7 +116,10 @@ class OAuthUtils { appendQueryParameter(QUERY_PARAMETER_CODE_CHALLENGE, codeChallenge) appendQueryParameter(QUERY_PARAMETER_CODE_CHALLENGE_METHOD, CODE_CHALLENGE_METHOD) appendQueryParameter(QUERY_PARAMETER_STATE, state) - if (!username.isNullOrEmpty()) appendQueryParameter(QUERY_PARAMETER_USERNAME, username) + if (!username.isNullOrEmpty()) { + appendQueryParameter(QUERY_PARAMETER_USER, username) + appendQueryParameter(QUERY_PARAMETER_LOGIN_HINT, username) + } }.build() fun buildRedirectUri(context: Context): Uri = diff --git a/owncloudData/src/main/java/com/owncloud/android/data/authentication/AuthenticationConstants.kt b/owncloudData/src/main/java/com/owncloud/android/data/authentication/AuthenticationConstants.kt index 635d7036b47..26d4e69c80e 100644 --- a/owncloudData/src/main/java/com/owncloud/android/data/authentication/AuthenticationConstants.kt +++ b/owncloudData/src/main/java/com/owncloud/android/data/authentication/AuthenticationConstants.kt @@ -2,7 +2,9 @@ * ownCloud Android client application * * @author David González Verdugo - * Copyright (C) 2020 ownCloud GmbH. + * @author Juan Carlos Garrote Gascón + * + * Copyright (C) 2024 ownCloud GmbH. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -58,4 +60,5 @@ const val QUERY_PARAMETER_PROMPT = "prompt" const val QUERY_PARAMETER_CODE_CHALLENGE = "code_challenge" const val QUERY_PARAMETER_CODE_CHALLENGE_METHOD = "code_challenge_method" const val QUERY_PARAMETER_STATE = "state" -const val QUERY_PARAMETER_USERNAME = "user" +const val QUERY_PARAMETER_USER = "user" +const val QUERY_PARAMETER_LOGIN_HINT = "login_hint"