From f950a7794cc79c94580432494b56caac1afc68c3 Mon Sep 17 00:00:00 2001 From: JuancaG05 Date: Mon, 22 Jan 2024 08:06:59 +0000 Subject: [PATCH 1/6] Calens changelog updated --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index efb0f98b2d7..9094a7cf7a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ ownCloud admins and users. ## Summary * Security - Improve biometric authentication security: [#4180](https://github.com/owncloud/android/issues/4180) +* Bugfix - Fixed AlertDialog title theme in Samsung Devices: [#3192](https://github.com/owncloud/android/issues/3192) * Bugfix - Some Null Pointer Exceptions in MainFileListViewModel: [#4065](https://github.com/owncloud/android/issues/4065) * Bugfix - Bugs related to Details view: [#4188](https://github.com/owncloud/android/issues/4188) * Bugfix - Some Null Pointer Exceptions fixed from Google Play: [#4207](https://github.com/owncloud/android/issues/4207) @@ -62,6 +63,13 @@ ownCloud admins and users. https://github.com/owncloud/android/issues/4180 https://github.com/owncloud/android/pull/4283 +* Bugfix - Fixed AlertDialog title theme in Samsung Devices: [#3192](https://github.com/owncloud/android/issues/3192) + + Use of device default theme was removed. + + https://github.com/owncloud/android/issues/3192 + https://github.com/owncloud/android/pull/4277 + * Bugfix - Some Null Pointer Exceptions in MainFileListViewModel: [#4065](https://github.com/owncloud/android/issues/4065) The MainFileListViewModel has prevented the fileById variable from crashing when From bcf79fd4217264a8abcca8b0302c3ae879c220e6 Mon Sep 17 00:00:00 2001 From: Juan Carlos Garrote Date: Mon, 22 Jan 2024 17:43:13 +0100 Subject: [PATCH 2/6] Added `login_hint` parameter to login request URL --- .../presentation/authentication/oauth/OAuthUtils.kt | 12 +++++++++--- .../data/authentication/AuthenticationConstants.kt | 7 +++++-- 2 files changed, 14 insertions(+), 5 deletions(-) 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" From c5e8b5a55a75eb8ae1d3c2de332340385895d923 Mon Sep 17 00:00:00 2001 From: Juan Carlos Garrote Date: Mon, 22 Jan 2024 18:22:55 +0100 Subject: [PATCH 3/6] New brandable parameter to indicate whether sending or not `login_hint` and `user` parameters in login request URL --- .../android/presentation/authentication/LoginActivity.kt | 1 + .../android/presentation/authentication/oauth/OAuthUtils.kt | 5 +++-- owncloudApp/src/main/res/values/setup.xml | 3 +++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/owncloudApp/src/main/java/com/owncloud/android/presentation/authentication/LoginActivity.kt b/owncloudApp/src/main/java/com/owncloud/android/presentation/authentication/LoginActivity.kt index 00b1a84a0ee..7a5439c8413 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/presentation/authentication/LoginActivity.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/presentation/authentication/LoginActivity.kt @@ -526,6 +526,7 @@ class LoginActivity : AppCompatActivity(), SslUntrustedCertDialog.OnSslUntrusted codeChallenge = authenticationViewModel.codeChallenge, state = authenticationViewModel.oidcState, username = username, + sendLoginHintAndUser = resources.getBoolean(R.bool.send_login_hint_and_user), ) try { 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 e71ee4204f0..8036404e19b 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 @@ -105,7 +105,8 @@ class OAuthUtils { prompt: String, codeChallenge: String, state: String, - username: String? + username: String?, + sendLoginHintAndUser: Boolean, ): Uri = authorizationEndpoint.buildUpon().apply { appendQueryParameter(QUERY_PARAMETER_REDIRECT_URI, redirectUri) @@ -116,7 +117,7 @@ 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()) { + if (sendLoginHintAndUser && !username.isNullOrEmpty()) { appendQueryParameter(QUERY_PARAMETER_USER, username) appendQueryParameter(QUERY_PARAMETER_LOGIN_HINT, username) } diff --git a/owncloudApp/src/main/res/values/setup.xml b/owncloudApp/src/main/res/values/setup.xml index ab76806838e..fbb92c8db47 100644 --- a/owncloudApp/src/main/res/values/setup.xml +++ b/owncloudApp/src/main/res/values/setup.xml @@ -143,4 +143,7 @@ true + + true + From 70fda39b1c195d623f54a1742021889e56b7945c Mon Sep 17 00:00:00 2001 From: Juan Carlos Garrote Date: Tue, 23 Jan 2024 10:12:08 +0100 Subject: [PATCH 4/6] New MDM parameter to indicate whether sending or not `login_hint` and `user` parameters in login request URL --- .../android/presentation/authentication/LoginActivity.kt | 7 +++++-- .../com/owncloud/android/ui/activity/SplashActivity.kt | 2 ++ .../java/com/owncloud/android/utils/MdmConfigurations.kt | 4 +++- .../src/main/res/values/strings__not_to_translate.xml | 5 ++++- owncloudApp/src/main/res/xml/managed_configurations.xml | 6 ++++++ 5 files changed, 20 insertions(+), 4 deletions(-) diff --git a/owncloudApp/src/main/java/com/owncloud/android/presentation/authentication/LoginActivity.kt b/owncloudApp/src/main/java/com/owncloud/android/presentation/authentication/LoginActivity.kt index 7a5439c8413..c71c1c4afab 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/presentation/authentication/LoginActivity.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/presentation/authentication/LoginActivity.kt @@ -8,8 +8,10 @@ * @author Christian Schabesberger * @author Shashvat Kedia * @author Abel García de Prada + * @author Juan Carlos Garrote Gascón + * * Copyright (C) 2012 Bartek Przybylski - * Copyright (C) 2022 ownCloud GmbH. + * 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, @@ -79,6 +81,7 @@ import com.owncloud.android.ui.activity.FileDisplayActivity import com.owncloud.android.ui.dialog.SslUntrustedCertDialog import com.owncloud.android.utils.CONFIGURATION_OAUTH2_OPEN_ID_PROMPT import com.owncloud.android.utils.CONFIGURATION_OAUTH2_OPEN_ID_SCOPE +import com.owncloud.android.utils.CONFIGURATION_SEND_LOGIN_HINT_AND_USER import com.owncloud.android.utils.CONFIGURATION_SERVER_URL import com.owncloud.android.utils.CONFIGURATION_SERVER_URL_INPUT_VISIBILITY import com.owncloud.android.utils.NO_MDM_RESTRICTION_YET @@ -526,7 +529,7 @@ class LoginActivity : AppCompatActivity(), SslUntrustedCertDialog.OnSslUntrusted codeChallenge = authenticationViewModel.codeChallenge, state = authenticationViewModel.oidcState, username = username, - sendLoginHintAndUser = resources.getBoolean(R.bool.send_login_hint_and_user), + sendLoginHintAndUser = mdmProvider.getBrandingBoolean(mdmKey = CONFIGURATION_SEND_LOGIN_HINT_AND_USER, booleanKey = R.bool.send_login_hint_and_user), ) try { diff --git a/owncloudApp/src/main/java/com/owncloud/android/ui/activity/SplashActivity.kt b/owncloudApp/src/main/java/com/owncloud/android/ui/activity/SplashActivity.kt index 446a1f82b04..6e42217b211 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/ui/activity/SplashActivity.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/ui/activity/SplashActivity.kt @@ -36,6 +36,7 @@ import com.owncloud.android.utils.CONFIGURATION_LOCK_DELAY_TIME import com.owncloud.android.utils.CONFIGURATION_OAUTH2_OPEN_ID_PROMPT import com.owncloud.android.utils.CONFIGURATION_OAUTH2_OPEN_ID_SCOPE import com.owncloud.android.utils.CONFIGURATION_REDACT_AUTH_HEADER_LOGS +import com.owncloud.android.utils.CONFIGURATION_SEND_LOGIN_HINT_AND_USER import com.owncloud.android.utils.CONFIGURATION_SERVER_URL import com.owncloud.android.utils.CONFIGURATION_SERVER_URL_INPUT_VISIBILITY @@ -56,6 +57,7 @@ class SplashActivity : AppCompatActivity() { cacheStringRestriction(CONFIGURATION_OAUTH2_OPEN_ID_PROMPT, R.string.oauth2_open_id_prompt_configuration_feedback_ok) cacheBooleanRestriction(CONFIGURATION_DEVICE_PROTECTION, R.string.device_protection_configuration_feedback_ok) cacheBooleanRestriction(CONFIGURATION_REDACT_AUTH_HEADER_LOGS, R.string.redact_auth_header_logs_configuration_feedback_ok) + cacheBooleanRestriction(CONFIGURATION_SEND_LOGIN_HINT_AND_USER, R.string.send_login_hint_and_user_configuration_feedback_ok) } } diff --git a/owncloudApp/src/main/java/com/owncloud/android/utils/MdmConfigurations.kt b/owncloudApp/src/main/java/com/owncloud/android/utils/MdmConfigurations.kt index 9f0243f2089..21c4384ed5c 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/utils/MdmConfigurations.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/utils/MdmConfigurations.kt @@ -3,7 +3,7 @@ * * @author Juan Carlos Garrote Gascón * - * Copyright (C) 2022 ownCloud GmbH. + * 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, @@ -33,6 +33,7 @@ const val CONFIGURATION_OAUTH2_OPEN_ID_SCOPE = "oauth2_open_id_scope" const val CONFIGURATION_OAUTH2_OPEN_ID_PROMPT = "oauth2_open_id_prompt" const val CONFIGURATION_DEVICE_PROTECTION = "device_protection" const val CONFIGURATION_REDACT_AUTH_HEADER_LOGS = "redact_auth_header_logs_configuration" +const val CONFIGURATION_SEND_LOGIN_HINT_AND_USER = "send_login_hint_and_user_configuration" @StringDef( NO_MDM_RESTRICTION_YET, @@ -44,6 +45,7 @@ const val CONFIGURATION_REDACT_AUTH_HEADER_LOGS = "redact_auth_header_logs_confi CONFIGURATION_OAUTH2_OPEN_ID_PROMPT, CONFIGURATION_DEVICE_PROTECTION, CONFIGURATION_REDACT_AUTH_HEADER_LOGS, + CONFIGURATION_SEND_LOGIN_HINT_AND_USER, ) @Retention(AnnotationRetention.SOURCE) @Target(AnnotationTarget.VALUE_PARAMETER) diff --git a/owncloudApp/src/main/res/values/strings__not_to_translate.xml b/owncloudApp/src/main/res/values/strings__not_to_translate.xml index 42e95e8329a..57af0e82df2 100644 --- a/owncloudApp/src/main/res/values/strings__not_to_translate.xml +++ b/owncloudApp/src/main/res/values/strings__not_to_translate.xml @@ -1,7 +1,7 @@ The lock delay was set correctly @@ -43,6 +45,7 @@ The OpenID Connect prompt was set correctly The app security forced when device not protected was set correctly The preference for redacting auth header in logs was set correctly + The preference for sending login_hint and user as parameters was set correctly Spaces diff --git a/owncloudApp/src/main/res/xml/managed_configurations.xml b/owncloudApp/src/main/res/xml/managed_configurations.xml index aa408334fb0..22ee11aa342 100644 --- a/owncloudApp/src/main/res/xml/managed_configurations.xml +++ b/owncloudApp/src/main/res/xml/managed_configurations.xml @@ -43,4 +43,10 @@ android:title="@string/redact_auth_header_logs_configuration_title" android:description="@string/redact_auth_header_logs_configuration_description" android:defaultValue="true" /> + From 9d5d15356021505dcce72bb9d0fa39e02405c013 Mon Sep 17 00:00:00 2001 From: Juan Carlos Garrote Date: Tue, 23 Jan 2024 10:20:59 +0100 Subject: [PATCH 5/6] Added calens file --- changelog/unreleased/4291 | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 changelog/unreleased/4291 diff --git a/changelog/unreleased/4291 b/changelog/unreleased/4291 new file mode 100644 index 00000000000..981f6a79e9e --- /dev/null +++ b/changelog/unreleased/4291 @@ -0,0 +1,7 @@ +Enhancement: New branding/MDM parameter to send `login_hint` and `user` params + +A new branding and MDM parameter has been created to decide if `login_hint` and `user` are +sent as parameters in the login request, so that a value is shown in the Username text field. + +https://github.com/owncloud/android/issues/4288 +https://github.com/owncloud/android/pull/4291 From 47416df259ec66eb40c141c98154fe90e72f403a Mon Sep 17 00:00:00 2001 From: JuancaG05 Date: Tue, 23 Jan 2024 09:21:26 +0000 Subject: [PATCH 6/6] Calens changelog updated --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9094a7cf7a0..2cc88499342 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -52,6 +52,7 @@ ownCloud admins and users. * Enhancement - New branding/MDM parameter to show sensitive auth info in logs: [#4249](https://github.com/owncloud/android/issues/4249) * Enhancement - Fix in the type handling of the content-type: [#4258](https://github.com/owncloud/android/issues/4258) * Enhancement - Manage password policy in live mode: [#4269](https://github.com/owncloud/android/issues/4269) +* Enhancement - New branding/MDM parameter to send `login_hint` and `user` params: [#4288](https://github.com/owncloud/android/issues/4288) ## Details @@ -260,6 +261,15 @@ ownCloud admins and users. https://github.com/owncloud/android/issues/4269 https://github.com/owncloud/android/pull/4276 +* Enhancement - New branding/MDM parameter to send `login_hint` and `user` params: [#4288](https://github.com/owncloud/android/issues/4288) + + A new branding and MDM parameter has been created to decide if `login_hint` and + `user` are sent as parameters in the login request, so that a value is shown in + the Username text field. + + https://github.com/owncloud/android/issues/4288 + https://github.com/owncloud/android/pull/4291 + # Changelog for ownCloud Android Client [4.1.1] (2023-10-18) The following sections list the changes in ownCloud Android Client 4.1.1 relevant to