"No basic authentication headers were found" message

Here we try to answer typical questions
Forum rules
The forums were migrated over to https://central.owncloud.org which is based on the forum software Discourse. The forums here is put into read-only mode starting from today.

More background information about this move and the reasoning behind it is available in this blogpost:

https://daniel.molkentin.net/2016/07/20 ... d-central/
RealRancor
ownCloud master
Posts: 17381
Joined: Sat May 26, 2012 3:00 pm
ownCloud version: 9.0.2
Webserver: nginx
Database: MySQL
OS: Linux
PHP version: 7.0.x

"No basic authentication headers were found" message

Postby RealRancor » Thu Sep 24, 2015 11:36 am

Please note that there can be other reasons for this error not solvable by the info posted here.

If everything is working skip to the bottom of this post.



Problem

The login to ownCloud via WebDAV, CalDAV and CardDAV is failing. Additionally this error is shown in your data/owncloud.log:

Code: Select all

401 No basic authentication headers were found


Description

Some Apache modules like mod_fastcgi, mod_fcgid or mod_proxy_fcgi in its default config are not passing the needed authentication headers to PHP. This is causing failed logins as the header is missing for it.

Solution

There is no "all in one" solution but you can try to add this to your Apache vhost configuration:

Code: Select all

SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1


before the line "ProxyPassMatch".

For mod_fastcgi a possible solution is to add this to the Apache config:

Code: Select all

FastCgiConfig -pass-header Authorization


Another way to passing the Headers with mod_fastcgi is to use a statement like this:

Code: Select all

FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi-owncloud -host 127.0.0.1:9004 -pass-header Authorization -flush -idle-timeout 330


in your vhost config.

Additional info

Further reading: http://www.christianroessler.net/tech/2 ... p-fpm.html

The "No basic authentication headers were found" message can also appear in your log file if everything (like sync clients) is working. Some clients tend to send no credentials at the first connection so this message also appears if you have a non-default loglevel => option configured within your config/config.php. Reset the option from logelevel => 0/1 to its default logelevel => 2 and the message will disappear.
Last edited by RealRancor on Thu Nov 12, 2015 9:50 pm, edited 1 time in total.
*gone*

fabrice.regnier
Beginner
Posts: 14
Joined: Tue Aug 05, 2014 11:06 am

Re: "No basic authentication headers were found" message

Postby fabrice.regnier » Thu Nov 12, 2015 1:06 pm

Hi,

I use neither fastcgi nor cgi. I use the apache php5_module instead.

I have this error too "401 No basic authentication headers were found" when connecting to caldav with android or thunderbird. But i must add that sync seems to work though.

Have you got any clue to get rid of these errors log ?

Server (debian/testing)
apache 2.4.17-2+b1 with php5_module
OC: 8.1.4-12.1
Calendar: 0.7.3
Task: 0.8
Contacts: 0.4.0.1

Client:
Davdroid 0.9.1 on Android 4.0.4
or
Thunderbird/lightning 38 on debian/stretch

regards,

Fabrice.

RealRancor
ownCloud master
Posts: 17381
Joined: Sat May 26, 2012 3:00 pm
ownCloud version: 9.0.2
Webserver: nginx
Database: MySQL
OS: Linux
PHP version: 7.0.x

Re: "No basic authentication headers were found" message

Postby RealRancor » Thu Nov 12, 2015 8:10 pm

Hi,

if everything is working change the loglevel from 0 or 1 to the default of 2 within your config/config.php. You shouldn't use a DEBUG loglevel at a producitive environment.
*gone*

fabrice.regnier
Beginner
Posts: 14
Joined: Tue Aug 05, 2014 11:06 am

Re: "No basic authentication headers were found" message

Postby fabrice.regnier » Thu Nov 12, 2015 9:23 pm

er, yes, you're right!

in config.php, i changed from 'loglevel' => 0 to 'loglevel' => 1

sorry for the noise.

regards,

f.

RealRancor
ownCloud master
Posts: 17381
Joined: Sat May 26, 2012 3:00 pm
ownCloud version: 9.0.2
Webserver: nginx
Database: MySQL
OS: Linux
PHP version: 7.0.x

Re: "No basic authentication headers were found" message

Postby RealRancor » Thu Nov 12, 2015 9:50 pm

Just have added the additional info about that into this FAQ.
*gone*


  • Similar Topics
    Replies
    Views
    Last post

Return to “FAQ”

Who is online

Users browsing this forum: No registered users and 1 guest