]> git.mxchange.org Git - friendica.git/commitdiff
Issue 13058: BasicAuth can now be disabled
authorMichael <heluecht@pirati.ca>
Sun, 30 Apr 2023 11:53:32 +0000 (11:53 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 30 Apr 2023 11:53:32 +0000 (11:53 +0000)
src/Security/BasicAuth.php
static/defaults.config.php

index 25da9b831818c3972ed206d3f305208df5e21db2..51da7a98ad472429d7f21b0d106b2129b8eb16f9 100644 (file)
@@ -177,7 +177,7 @@ class BasicAuth
                        }
                        Logger::debug('Access denied', ['parameters' => $_SERVER]);
                        // Checking for commandline for the tests, we have to avoid to send a header
-                       if (php_sapi_name() !== 'cli') {
+                       if (DI::config()->get('system', 'basicauth') && (php_sapi_name() !== 'cli')) {
                                header('WWW-Authenticate: Basic realm="Friendica"');
                        }
                        throw new UnauthorizedException("This API requires login");
index 3c4fdd762b3de0f0183838e74a742bd914f56fdc..7e699fad714ba3f6a06368bd3c6fcd6fc0156ce3 100644 (file)
@@ -132,6 +132,10 @@ return [
                // The value has to start with the scheme and end with a "/"
                'avatar_cache_url' => '',
 
+               // basicauth (Boolean)
+               // Controls if login via BasicAuth is possible (default is true)
+               'basicauth' => true,
+
                // big_emojis (Boolean)
                // Display "Emoji Only" posts in big.
                'big_emojis' => false,