Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nextcloud 16 won't connect (No 'Authorization: Bearer' header found.) #2219

Closed
atoav opened this issue Dec 23, 2019 · 10 comments
Closed

Nextcloud 16 won't connect (No 'Authorization: Bearer' header found.) #2219

atoav opened this issue Dec 23, 2019 · 10 comments
Labels
bug It's a bug

Comments

@atoav
Copy link

atoav commented Dec 23, 2019

When I try to setup Syncing with my own nextcloud instance from my Windows Client, the connection fails with the following Error:

Error. Please check that URL, username, password, etc. are correct and that the sync target is accessible. The reported error was:
PROPFIND : Username or password was incorrect, No 'Authorization: Bearer' header found. Either the client didn't send one, or the server is mis-configured (Exception Sabre\DAV\Exception\NotAuthenticated) (401): <?xml version="1.0" encoding="utf-8"?> <d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns"> <s:exception>Sabre\DAV\Exception\NotAuthenticated</s:exception> <s:message>Username or password was incorrect, No 'Authorization: Bearer' header found. Either the client didn't send one, or the server is mis-configured</s:message> </d:error> (Code 401)

The credentials come directly from my password manager that I also use for logins into the web interface of nextcloud, so there is no way they are wrong (I additionally tried to type it by hand, with no real success). The URL points to an existing directory on the cloud instance and I tripplechecked that one as well (https://cloud.atoav.com/remote.php/webdav/Joplin). My certificate is not self signed.

nextcloud

The specivity of the message leads me to believe this could be a bug (maybe due to changes how nextclouds wants WebDAV Clients to authenticate?). I didn't do much with my Nextcloud Installation so I would be surprised if this had anything to do with my Server...

Environment

Joplin version: 1.0.175 (Build 8c1d13b)
Platform: Windows 10 Pro
OS specifcs: 10.0.18363 Build 18363 (x64)
Nextcloud Version: 16.0.5.

Steps To Reproduce

  1. Enter username, password and URL
  2. Click the Button "Check synchronisation configuration"
  3. After a few seconds the above-mentioned Error message shows up.

Logfile

There is nothing showing up in the logfile – in my judgment the message above should be enough

@atoav atoav added the bug It's a bug label Dec 23, 2019
@atoav atoav changed the title Nextcloud won't connect (No 'Authorization: Bearer' header found.) Nextcloud 16 won't connect (No 'Authorization: Bearer' header found.) Dec 23, 2019
@tessus
Copy link
Collaborator

tessus commented Dec 23, 2019

Do you have 2FA activated on Nextcloud? If yes, please open a topic in the forum.

@atoav
Copy link
Author

atoav commented Dec 23, 2019

Do you have 2FA activated on Nextcloud?

No, it is actually deactivated

@tessus
Copy link
Collaborator

tessus commented Dec 23, 2019

Hmm, many people (including myself) use Joplin with Nextcloud. This is the first time I've heard of this error. I can't reproduce the problem.

I'd still suggest to post this to the forum. Maybe somebody has seen this before. The forum is read by a lot more people. The tracker on gh is mainly for Laurent and other devs.

I suspect it's a config problem. Either with Nextcloud, web server, reverse proxy, docker image, ....

@atoav
Copy link
Author

atoav commented Dec 24, 2019

Thanks for the advice – I crossposted to this topic.

@tessus
Copy link
Collaborator

tessus commented Dec 24, 2019

Yep, I saw it. Let's hope somebody has a solution. I googled the error and I came across a few comments that the authorization header was not properly propagated to the nextcoud system (e.g. from Apache httpd or HAproxy).
I have run tests with Nextcloud 15 and 16 and could not reproduce the issue.
I'm currently pressed for time, otherwise I would have deliberatly introduced misconfigurations to elicit above mentioned error somehow.

@atoav
Copy link
Author

atoav commented Dec 24, 2019

My nextcloud instance runs behind an (managed) Apache, so I am not completely in control of that Server – might have something to do with that.

@atoav
Copy link
Author

atoav commented Dec 26, 2019

Thanks for the hint. This issue in the Nextcloud repo seems to back your theory. I asked the support at my hoster to open a ticket and will post any conclusions here. Right now I can't say 100% certain that it is a Apache issue, but if it is, I will close this.

@tessus
Copy link
Collaborator

tessus commented Dec 29, 2019

Please post the solution and info to the forum - in case you will have found one. If somebody runs into the same issue in the future, they will have a solution.
Almost noone ever searches gh issues.

@atoav
Copy link
Author

atoav commented Dec 31, 2019

Okay found a solution.

What I did was to use my own username and password, while in fact I should have created a device password for Joplin and used that one instead. That means I had to go to Settings → Personal: Security → Devices & Sessions and create a new App name and password there for Joplin.

Once I used this newly generated password from within Joplin it worked.

This is a bit of a emberassing error, but I might not be the only one who gets this wrong : )

@atoav atoav closed this as completed Dec 31, 2019
@tessus
Copy link
Collaborator

tessus commented Dec 31, 2019

Aha, 2FA and tokens....

@lock lock bot locked and limited conversation to collaborators Jan 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug It's a bug
Projects
None yet
Development

No branches or pull requests

2 participants