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>
pull/42459/head
MichaIng 5 months ago
parent de4e48370f
commit 91127edcc8

@ -63,7 +63,7 @@ class LegacyPublicAuth extends AbstractBasic {
// setup realm
$defaults = new \OCP\Defaults();
$this->realm = $defaults->getName();
$this->realm = $defaults->getName() ?: 'Nextcloud';
}
/**

@ -75,7 +75,7 @@ class Auth extends AbstractBasic {
// setup realm
$defaults = new \OCP\Defaults();
$this->realm = $defaults->getName();
$this->realm = $defaults->getName() ?: 'Nextcloud';
}
/**

@ -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) {

Loading…
Cancel
Save