diff options
author | MichaIng <micha@dietpi.com> | 2023-12-22 04:10:07 +0100 |
---|---|---|
committer | MichaIng <micha@dietpi.com> | 2024-02-14 16:49:39 +0100 |
commit | 91127edcc8b61ce3b8db45c442cc971712e962b8 (patch) | |
tree | 8b04ec1a51b5e16ebe5c9ba1a366b7d025db5ca5 /apps | |
parent | de4e48370fb9f3717bb13158f9d842e3696d98e8 (diff) | |
download | nextcloud-server-91127edcc8b61ce3b8db45c442cc971712e962b8.tar.gz nextcloud-server-91127edcc8b61ce3b8db45c442cc971712e962b8.zip |
fix(dav): fallback realm for HTTP authentication
By default, the name of the Nextcloud instance is an empty string, until changed by the admin. This leads to an empty realm sent with the WWW-Authenticate header, while the realm is mandatory for Basic HTTP authentication. Some clients have issues with an empty realm, e.g. Thunderbird cannot store passwords in this case.
This commit applies "Nextcloud" as fallback for the realm, in case the name of the Nextcloud instance is not set.
Solves: https://help.nextcloud.com/t/thunderbird-dont-save-caldav-password-because-of-missing-httprealm-or-formsubmiturl/93233
Signed-off-by: MichaIng <micha@dietpi.com>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/dav/lib/Connector/LegacyPublicAuth.php | 2 | ||||
-rw-r--r-- | apps/dav/lib/Connector/Sabre/Auth.php | 2 | ||||
-rw-r--r-- | apps/dav/lib/Connector/Sabre/BearerAuth.php | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/apps/dav/lib/Connector/LegacyPublicAuth.php b/apps/dav/lib/Connector/LegacyPublicAuth.php index c2cc81103bd..82a474d4bed 100644 --- a/apps/dav/lib/Connector/LegacyPublicAuth.php +++ b/apps/dav/lib/Connector/LegacyPublicAuth.php @@ -63,7 +63,7 @@ class LegacyPublicAuth extends AbstractBasic { // setup realm $defaults = new \OCP\Defaults(); - $this->realm = $defaults->getName(); + $this->realm = $defaults->getName() ?: 'Nextcloud'; } /** diff --git a/apps/dav/lib/Connector/Sabre/Auth.php b/apps/dav/lib/Connector/Sabre/Auth.php index 243b92e63f7..c2e343d8656 100644 --- a/apps/dav/lib/Connector/Sabre/Auth.php +++ b/apps/dav/lib/Connector/Sabre/Auth.php @@ -75,7 +75,7 @@ class Auth extends AbstractBasic { // setup realm $defaults = new \OCP\Defaults(); - $this->realm = $defaults->getName(); + $this->realm = $defaults->getName() ?: 'Nextcloud'; } /** diff --git a/apps/dav/lib/Connector/Sabre/BearerAuth.php b/apps/dav/lib/Connector/Sabre/BearerAuth.php index 4d9599b97a3..6fd61c44b34 100644 --- a/apps/dav/lib/Connector/Sabre/BearerAuth.php +++ b/apps/dav/lib/Connector/Sabre/BearerAuth.php @@ -47,7 +47,7 @@ class BearerAuth extends AbstractBearer { // setup realm $defaults = new \OCP\Defaults(); - $this->realm = $defaults->getName(); + $this->realm = $defaults->getName() ?: 'Nextcloud'; } private function setupUserFs($userId) { |