server icon indicating copy to clipboard operation
server copied to clipboard

No 'Authorization: Basic' header found

Open mcnesium opened this issue 8 years ago • 41 comments

For about a week now my Nextcloud Calendars will not show up on my iOS device anymore, after this worked well for ages. I deleted and re-added the CalDAV account. When I added the credentials, the iOS complained, it cannot connect using SSL, though the certificate is valid and rated A+.

When I toggled the Calendars switch, the following was written to nextcloud.log:

{"reqId":"YroUHvIWhjVsrwKTDBMU","level":0,"time":"2018-01-23T19:12:52+00:00","remoteAddr":"2a02:2450:20d2:f:1c3a:cf22:2d48:2a23","user":"--","app":"webdav","method":"OPTIONS","url":"\/remote.php\/dav\/principals\/users\/mcnesium\/","message":"Exception: {\"Exception\":\"Sabre\\\\DAV\\\\Exception\\\\NotAuthenticated\",\"Message\":\"No public access to this resource., No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured, No 'Authorization: Bearer' header found. Either the client didn't send one, or the server is mis-configured, No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured\",\"Code\":0,\"Trace\":\"#0 [internal function]: Sabre\\\\DAV\\\\Auth\\\\Plugin->beforeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#1 \\\/var\\\/www\\\/cloud.elektrat.de\\\/3rdparty\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#2 \\\/var\\\/www\\\/cloud.elektrat.de\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(466): Sabre\\\\Event\\\\EventEmitter->emit('beforeMethod', Array)\\n#3 \\\/var\\\/www\\\/cloud.elektrat.de\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#4 \\\/var\\\/www\\\/cloud.elektrat.de\\\/apps\\\/dav\\\/lib\\\/Server.php(258): Sabre\\\\DAV\\\\Server->exec()\\n#5 \\\/var\\\/www\\\/cloud.elektrat.de\\\/apps\\\/dav\\\/appinfo\\\/v2\\\/remote.php(33): OCA\\\\DAV\\\\Server->exec()\\n#6 \\\/var\\\/www\\\/cloud.elektrat.de\\\/remote.php(162): require_once('\\\/var\\\/www\\\/cloud....')\\n#7 {main}\",\"File\":\"\\\/var\\\/www\\\/cloud.elektrat.de\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Auth\\\/Plugin.php\",\"Line\":168}","userAgent":"iOS\/9.3.5 (13G36) dataaccessd\/1.0","version":"12.0.4.3"}
{"reqId":"BX7UOtyKN3SRrIqvHWO3","level":0,"time":"2018-01-23T19:12:53+00:00","remoteAddr":"2a02:2450:20d2:f:1c3a:cf22:2d48:2a23","user":"--","app":"webdav","method":"PROPFIND","url":"\/remote.php\/dav\/addressbooks\/users\/mcnesium\/","message":"Exception: {\"Exception\":\"Sabre\\\\DAV\\\\Exception\\\\NotAuthenticated\",\"Message\":\"No public access to this resource., No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured, No 'Authorization: Bearer' header found. Either the client didn't send one, or the server is mis-configured, No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured\",\"Code\":0,\"Trace\":\"#0 [internal function]: Sabre\\\\DAV\\\\Auth\\\\Plugin->beforeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#1 \\\/var\\\/www\\\/cloud.elektrat.de\\\/3rdparty\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#2 \\\/var\\\/www\\\/cloud.elektrat.de\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(466): Sabre\\\\Event\\\\EventEmitter->emit('beforeMethod', Array)\\n#3 \\\/var\\\/www\\\/cloud.elektrat.de\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#4 \\\/var\\\/www\\\/cloud.elektrat.de\\\/apps\\\/dav\\\/lib\\\/Server.php(258): Sabre\\\\DAV\\\\Server->exec()\\n#5 \\\/var\\\/www\\\/cloud.elektrat.de\\\/apps\\\/dav\\\/appinfo\\\/v2\\\/remote.php(33): OCA\\\\DAV\\\\Server->exec()\\n#6 \\\/var\\\/www\\\/cloud.elektrat.de\\\/remote.php(162): require_once('\\\/var\\\/www\\\/cloud....')\\n#7 {main}\",\"File\":\"\\\/var\\\/www\\\/cloud.elektrat.de\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Auth\\\/Plugin.php\",\"Line\":168}","userAgent":"iOS\/9.3.5 (13G36) dataaccessd\/1.0","version":"12.0.4.3"}

So I am wondering, what might have happened to my setup, as I cannot tell what has changed. iOS 9.3.5 is way end of life and Nextcloud calendar has not been updated for more than a month. How come this stopped working? Any ideas?

mcnesium avatar Jan 23 '18 19:01 mcnesium

Interesting side note: the corresponding CardDAV connection works fine from that device to the same Nextcloud instance.

mcnesium avatar Jan 24 '18 09:01 mcnesium

same situation after upgrading NC to v12.0.5.3

mcnesium avatar Jan 24 '18 14:01 mcnesium

EDIT: My issue is fixed somehow, I didn't change anything, just went to bed for 10 hours and it helped! Now syncing with NC13 & iOS 11! Carddav & Caldav

I have the same issue with NC13 and iOS11. Any idea?

I run NC with apache, the .htaccess works fine. Desktop app works with app token & mobile app registers but is not showing data.

Funny fact: When I updated to NC13 (from NC12) it all worked but when I changed my password to NC, the apps won't sync with the newly created app tokens.

georg90 avatar Mar 02 '18 23:03 georg90

I ~~solved this~~ got rid of this problem by not entering just the domain of the nextcloud instance but the entire iOS/OSX url proposed in the "Settings & import" section on the lower left of the calendar app. This should actually not be necessary because of CalDAV auto-discovery and it did work fine for quite while, but oh well…

mcnesium avatar Mar 04 '18 12:03 mcnesium

Same for me, I remember adding the complete path (iOS caldav path) and it worked, but when I closed settings and went back again, it will cut the URL to the main URL and it seemes like its using auto discovery. Anyway it’s working again :-)

georg90 avatar Mar 04 '18 13:03 georg90

I get the same error. However, I use the export url to integrate the calendar as internet calendar in outlook:

mynextcloud/remote.php/dav/calendars/username/default?export

I'm not sure if it happened while updating from 12.x to 13 or while moving from outlook 2010 to 2016. Any idea how to change the behaviour?

avanc avatar Mar 08 '18 10:03 avanc

Heloo,

same problem after install package php-pear-Auth-SASL on system Centos7 with php71w and NC12.0.6

Recovery from snapshot :-), remove package no effect.

Havrla

havrla avatar Mar 26 '18 22:03 havrla

Hello,

NC 13.0.0.14 here, PHP 7.2. Works on Windows10 client but not on MacOS and iOS.

Thanks,

mailanetworks avatar Apr 10 '18 00:04 mailanetworks

Same here with NC 13.0.1: Sabre\DAV\Exception\NotAuthenticated: No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured

.... Just happened can't tell why. This was a new installation.

lenusch avatar Apr 10 '18 15:04 lenusch

+1

  • next cloud 13.0.1
  • Mac OS 10.13.3

hudecof avatar Apr 13 '18 23:04 hudecof

+1

  • MacOS 10.13.4
  • nextcloud 13.0.1
  • php 7.1.16

While investigating the issue I tried to use MacOS's addressbook app and calendar app. I noticed a few things:

  • The calendar app synchronizes successfully although the webserver's access log says
IP - - [24/Apr/2018:20:38:24 +0200] "PROPFIND /remote.php/dav/calendars/username/ HTTP/1.1" 401 557 "-" "Mac+OS+X/10.13.4 (17E199) CalendarAgent/399.2.2" "-"

and the nextcloud log says

{"reqId":"asdf","level":0,"time":"2018-04-24T18:38:24+00:00","remoteAddr":"IP","user":"--","app":"webdav","method":"PROPFIND","url":"\/remote.php\/dav\/calendars\/username\/","messag
e":"Exception: {\"Exception\":\"Sabre\\\\DAV\\\\Exception\\\\NotAuthenticated\",\"Message\":\"No public access to this resource., No 'Authorization: Basic' header found. Either the client didn't send one,
 or the server is misconfigured, No 'Authorization: Bearer' header found. Either the client didn't send one, or the server is mis-configured, No 'Authorization: Basic' header found. Either the client didn
't send one, or the server is misconfigured\",\"Code\":0,\"Trace\":\"#0 [internal function]: Sabre\\\\DAV\\\\Auth\\\\Plugin->beforeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response
))\\n#1 \\\/var\\\/www\\\/html\\\/3rdparty\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#2 \\\/var\\\/www\\\/html\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\
\\/Server.php(466): Sabre\\\\Event\\\\EventEmitter->emit('beforeMethod', Array)\\n#3 \\\/var\\\/www\\\/html\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMeth
od(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#4 \\\/var\\\/www\\\/html\\\/apps\\\/dav\\\/lib\\\/Server.php(283): Sabre\\\\DAV\\\\Server->exec()\\n#5 \\\/var\\\/www\\\/html\\\/
apps\\\/dav\\\/appinfo\\\/v2\\\/remote.php(35): OCA\\\\DAV\\\\Server->exec()\\n#6 \\\/var\\\/www\\\/html\\\/remote.php(164): require_once('\\\/var\\\/www\\\/html\\\/a...')\\n#7 {main}\",\"File\":\"\\\/var
\\\/www\\\/html\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Auth\\\/Plugin.php\",\"Line\":168}","userAgent":"Mac+OS+X\/10.13.4 (17E199) CalendarAgent\/399.2.2","version":"13.0.1.1"}
  • The addressbook does not sync at all with the almost the same messages in the logs. The only difference being the different URL path.
  • In both cases the Authentication header is not set. I know this because the last part of the access log format is the header (the last "-").
  • If I set the Authentication header in the apache config manually, the MacOS apps ask me for a password in a pop-up window. If I enter the password the sync does not work not all with both apps and the pop-up window reappears.

shoelzle avatar Apr 24 '18 18:04 shoelzle

I have the same problem, with the PhotoSync App and Webdav.

Had the problem for a couple of months now, but only started investigating now. First apperance of the problem was about the time of the first posting here.

ax-meyer avatar Jun 06 '18 15:06 ax-meyer

Same problem with with Nextcloud 13.0.4 Kontact 5.8.2, Evolution 3.18.5.2 und Thunderbird 52.8.0+SoGoConnector 31.0.5.

An example log when using Kontact:

nextcloud[18252]: {webdav} Exception: {"Exception":"Sabre\\DAV\\Exception\\NotAuthenticated","Message":"No public access to this resource., No 'Authorization: Basic' header fou
nd. Either the client didn't send one, or the server is misconfigured, No 'Authorization: Bearer' header found. Either the client didn't send one, or the server is mis-configured, No 'Authorization
: Basic' header found. Either the client didn't send one, or the server is misconfigured","Code":0,"Trace":"#0 [internal function]: Sabre\\DAV\\Auth\\Plugin->beforeMethod(Object(Sabre\\HTTP\\Reques
t), Object(Sabre\\HTTP\\Response))\n#1 \/var\/www\/nextcloud\/3rdparty\/sabre\/event\/lib\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\n#2 \/var\/www\/nextcloud\/3rdparty\/sabre\
/dav\/lib\/DAV\/Server.php(466): Sabre\\Event\\EventEmitter->emit('beforeMethod', Array)\n#3 \/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(254): Sabre\\DAV\\Server->invokeMethod
(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#4 \/var\/www\/nextcloud\/apps\/dav\/lib\/Server.php(287): Sabre\\DAV\\Server->exec()\n#5 \/var\/www\/nextcloud\/apps\/dav\/appinfo\/v
2\/remote.php(35): OCA\\DAV\\Server->exec()\n#6 \/var\/www\/nextcloud\/remote.php(164): require_once('\/var\/www\/nextcl...')\n#7 {main}","File":"\/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/D
AV\/Auth\/Plugin.php","Line":168}

alexeyabel avatar Jun 27 '18 21:06 alexeyabel

Did you check the version of calendar application?

I figured out that my Nextcloud instance did no longer check the calendar pluggin version and did no longer display any notification for available calendar upgrade. I had to upgrade it manually to the latest version to solve the problem.

leschard avatar Jul 01 '18 21:07 leschard

Did you check the version of calendar application?

Yes, I am using the current Calendar version 1.6.1.

alexeyabel avatar Jul 04 '18 18:07 alexeyabel

I don't know if this is relevant but I had the same problem, and above the exception I noticed "Brute force attack detected" because I had several devices and had just changed the password.

Also, my Brute-Force app was out of date and could not be configured. Updating the app and adding the IP to the exclusions fixed all the problems.

I'm guessing the person for whom the problem just cleared up was subsequently removed from the brute-force list.

Grunthos avatar Jul 19 '18 03:07 Grunthos

Same here with Nextcloud Android app

{"reqId":"eSU01CFbver4tFSE7iWl","level":1,"time":"2018-08-16T06:15:55+00:00","remoteAddr":"xxmyipxx","user":"--","app":"admin_audit","method":"PUT","url":"\/remote.php\/webdav\/InstantUpload\/Conversations%20Images\/899fc1af-e594-4edf-8d34-ed0079bef9fe.jpg","message":"Login attempt: \"xxmyusernamexx\"","userAgent":"Mozilla\/5.0 (Android) ownCloud-android\/3.2.1","version":"13.0.4.0"}
{"reqId":"eSU01CFbver4tFSE7iWl","level":2,"time":"2018-08-16T06:15:55+00:00","remoteAddr":"xxmyipxx","user":"--","app":"core","method":"PUT","url":"\/remote.php\/webdav\/InstantUpload\/Conversations%20Images\/899fc1af-e594-4edf-8d34-ed0079bef9fe.jpg","message":"Login failed: 'xxmyusernamexx' (Remote IP: 'xxmyipxx')","userAgent":"Mozilla\/5.0 (Android) ownCloud-android\/3.2.1","version":"13.0.4.0"}
{"reqId":"eSU01CFbver4tFSE7iWl","level":1,"time":"2018-08-16T06:15:55+00:00","remoteAddr":"xxmyipxx","user":"--","app":"core","method":"PUT","url":"\/remote.php\/webdav\/InstantUpload\/Conversations%20Images\/899fc1af-e594-4edf-8d34-ed0079bef9fe.jpg","message":"Bruteforce attempt from \"xxmyipxx\" detected for action \"login\".","userAgent":"Mozilla\/5.0 (Android) ownCloud-android\/3.2.1","version":"13.0.4.0"}
{"reqId":"eSU01CFbver4tFSE7iWl","level":0,"time":"2018-08-16T06:15:55+00:00","remoteAddr":"xxmyipxx","user":"--","app":"webdav","method":"PUT","url":"\/remote.php\/webdav\/InstantUpload\/Conversations%20Images\/899fc1af-e594-4edf-8d34-ed0079bef9fe.jpg","message":"Exception: {\"Exception\":\"Sabre\\\\DAV\\\\Exception\\\\NotAuthenticated\",\"Message\":\"Username or password was incorrect, No 'Authorization: Bearer' header found. Either the client didn't send one, or the server is mis-configured\",\"Code\":0,\"Trace\":\"#0 [internal function]: Sabre\\\\DAV\\\\Auth\\\\Plugin->beforeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#1 \\\/var\\\/www\\\/3rdparty\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#2 \\\/var\\\/www\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(466): Sabre\\\\Event\\\\EventEmitter->emit('beforeMethod', Array)\\n#3 \\\/var\\\/www\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#4 \\\/var\\\/www\\\/apps\\\/dav\\\/appinfo\\\/v1\\\/webdav.php(80): Sabre\\\\DAV\\\\Server->exec()\\n#5 \\\/var\\\/www\\\/remote.php(164): require_once('\\\/var\\\/www\\\/apps\\\/d...')\\n#6 {main}\",\"File\":\"\\\/var\\\/www\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Auth\\\/Plugin.php\",\"Line\":168}","userAgent":"Mozilla\/5.0 (Android) ownCloud-android\/3.2.1","version":"13.0.4.0"}

EDIT: Worked around this problem by using app passwords.

gjedeer avatar Aug 16 '18 06:08 gjedeer

I've had this isse too; For me is seems had to be caused by the brute-force plugin: A user has changed their password but still had a client trying to connect to is. Symptom for me was that the log contained :

The app to connect to the nextcloud was the Android nextcloud app (as well as keepass4android)

Debug	webdav	Sabre\DAV\Exception\NotAuthenticated: No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured, No 'Authorization: Bearer' header found. Either the client didn't send one, or the server is mis-configured	2018-08-18T16:45:50+0200
Debug	webdav	Sabre\DAV\Exception\NotAuthenticated: Username or password was incorrect, No 'Authorization: Bearer' header found. Either the client didn't send one, or the server is mis-configured	2018-08-18T16:45:46+0200
Info	core	Bruteforce attempt from "xxx.xxx.xxx.xxx" detected for action "login". 2018-08-18T16:45:46+0200
Warning	core	Login failed: '<user>' (Remote IP: 'xxx.xxx.xxx.xxx')	2018-08-18T16:45:46+0200

Deactivating the brute-force plugin did not help, I did remove it later and it worked again, but this could be co-incidal with some timeout of the ban.Interestingly, I could still login using the webinterface (but maybe this because I'm admin?). Another data point: Not only the banned user was affected, also me (we were on the banned ip)

coldtobi avatar Aug 19 '18 07:08 coldtobi

I have the problem with photosync. I am using NC 13.0.0.5 and PHP 7.2. It has started when I switched to an FPM Installation of PHP and the event version of Apache. Switching back to the prefork apache and libmod php "solved" the problem.

Twilek-de avatar Aug 19 '18 18:08 Twilek-de

I switched to FPM and kept prefork. Keeps working. Switching to worker or event produces the error.

Twilek-de avatar Aug 19 '18 19:08 Twilek-de