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 (and webdav sync) not working with non-ascii characters in password #478

Open
lindhe opened this issue Jul 30, 2018 · 25 comments
Open
Milestone

Comments

@lindhe
Copy link

lindhe commented Jul 30, 2018

I'm not 100% sure it's your fault—it could be something broken on my Nextcloud installation—but since I didn't have any problems before upgrading to the beta version on Google Play, it feels like it's caused by the app.

I can not add a Nextcloud (or Nextcloud-hosted https/webdav) account to sync a database file. I'm just presented with the following error every time:

screenshot_20180730-081521_keepass2android

I'll add logs shortly. But today I'm too tired to trust myself to properly vet the log from plaintext passwords.

EDIT: Adding the text so that it can be indexed better in search engines.

Error Cannot connect to file provider service Received unexpected response: Response{protocol=http/1.1, code=401, message=Unauthorized, url=https://nextcloud.lindhe.io/remote.php/webdav}

@firesoft-de
Copy link

Same here, except protocoll=h2

@ouzowtf
Copy link

ouzowtf commented Jul 31, 2018

Webdav works for me. After several testing I found out that I have to use the full username (complete email address) for the login, instead of the short one (without @domain.tld).
I don't know if this was the exact same error message, but it was a similar type.

@lindhe
Copy link
Author

lindhe commented Jul 31, 2018

I tried to produce some logs today, but I literally couldn't. Nothing happens when I press the "Send debug log..." button. Is that the case for you guys?

I tried reinstalling the app and restart the phone, but with no avail. If anyone else is having this problem with the logs, we'll probably need to hunt that one down first.

@lindhe
Copy link
Author

lindhe commented Aug 7, 2018

#286 is definitely the same issue. Sorry for missing it when opening this ticket. I'll leave this alive, just to make it easier to find when searching.

@serioustk
Copy link

I encountered the same issue today.
The problem was that I had a german umlaut in my password. I removed the affected character and everything worked out well.
Hope this helps someone.

@lindhe
Copy link
Author

lindhe commented Feb 14, 2019

Interesting. Yeah, the same for me. When going only with ASCII characters, it works. Might there be a missing encoding to URL format? It seems like the password is passed in a variable called httpPath, that's why the thought struck me...

string httpPath = new Keepass2android.Javafilestorage.WebDavStorage(null).BuildFullPath(WebDavFileStorage.Owncloud2Webdav(host, subtype == "owncloud" ? WebDavFileStorage.owncloudPrefix : WebDavFileStorage.nextcloudPrefix), user,
password);
onStartBrowse(httpPath);

@PhilippC PhilippC added this to the 1.08 milestone Feb 18, 2019
@dbielz
Copy link

dbielz commented May 3, 2019

Maybe something different? See #747 , I have no Umlauts in my password.

@firesoft-de
Copy link

I can confirm @serioustk, thanks btw
In my case the problem was also related to non ascii / unicode chars in the password. I was able to bypass the problem by using an "app-password" generated via nextcloud user menu Settings / Security / Devices&Session / Generate new app password .
These passwords don't contain any unicode chars and you don't have to change the main password for your account.

Had the exact same problem with the desktop version of keepass. Are there any libraries which are used by both android and pc?

@PhilippC PhilippC changed the title Nextcloud (and webdav sync) seems to be broken Nextcloud (and webdav sync) not working with non-ascii characters in password Oct 7, 2019
@siegmund42
Copy link

siegmund42 commented Oct 31, 2019

Today it happened to me as well, getting a 401 as long as I have a German umlaut (non-ASCII) in my password. If I remove it, everything is just fine..
I'm not very deep into the topic, but the cause seems to be an encoding mismatch between nextcloud server and your client, see owncloud/core#7894 for explanation.
So could you please try a UTF8 encoding in the client?

@siegmund42
Copy link

I was able to bypass the problem by using an "app-password" generated via nextcloud user menu Settings / Security / Devices&Session / Generate new app password .
These passwords don't contain any unicode chars and you don't have to change the main password for your account.

@firesoft-de Thanks for this nice workaround, by the way!

@PhilippC
Copy link
Owner

I just tested this with an account on https://webdav.smartdrive.web.de and did not have any problems with password encoding. Is this maybe related to nextcloud/server#1731?

@PhilippC
Copy link
Owner

closing as no response

@antiFetzen
Copy link

Please reopen, the issue still exists.

I changed my password it includes umlauts and I couldn't sign in with Keepass2Android.

No Problem with the WebUI, the Clients on Mac, Windows and Android. Sign in to the WebDAV direct by the URL and BasicAuth works find.
I downloaded WebDAV Navigator Lite to try it with a WebDAV client also no problem.

Is there a URI encoding for the password for the request?

@firesoft-de good to know, I have done it this way now. Thanks!

@PhilippC PhilippC reopened this Oct 5, 2020
@PhilippC
Copy link
Owner

PhilippC commented Oct 5, 2020

can you provide a test account for me?

@antiFetzen
Copy link

antiFetzen commented Oct 5, 2020 via email

@PhilippC
Copy link
Owner

thanks a lot for sharing the credentials. Sorry that I didn't find time to look into this earlier. I just tried to connect (using Cyberduck) but received 405 Method not allowed. How do you test?

@mxmilkiib
Copy link

I just had keepassxc generate RzD#8MK=X+%"xiA9 for my Nextcloud (YunoHost SSO) password, but that fails with h2 401, and dialing it back to just ascii worked.

@mxmilkiib
Copy link

I just had keepassxc generate RzD#8MK=X+%"xiA9 for my Nextcloud (YunoHost SSO) password, but that fails with h2 401, and dialing it down to no symbols worked.

@PhilippC
Copy link
Owner

@mxmilkiib if you can provide a test account I can try to fix this.

@E-Vul
Copy link

E-Vul commented May 19, 2021

Just had same issue (code 401 Unauthorized) corrected after I set a new password only with ASCII characters on my NextCloud account (at zaclys.com).
Keepass2Android Version 1.08d-r5 (have Android 8.0.0 — Samsung)
Thanks for this very good software (otherwise!)

@ptandler
Copy link

I use Keepass2Android version 1.09a-r3 on Android 10 and had the same issue. @firesoft-de 's workaround with the app password worked fine.

@minils
Copy link

minils commented Sep 25, 2022

Using v1.09d-r0 we have the same problem with Nextcloud v24.0.5 and a password containing umlauts.
Changing the password did however solve the issue.

@dannywillems
Copy link

dannywillems commented Oct 13, 2022

Facing the same issue. However, it seems it is related to OTP. I had to deactivate it to make it work again. Non-ASCII caracters do not seem to be a problem.
Version: 1.09c-r0

@ffrosch
Copy link

ffrosch commented Feb 1, 2023

I was able to bypass the problem by using an "app-password" generated via nextcloud user menu Settings / Security / Devices&Session / Generate new app password . These passwords don't contain any unicode chars and you don't have to change the main password for your account.

@firesoft-de: Thank you, that solved the problem for me!

The only weird thing is: the problem just appeared recently for me, although I have been using Keepass2Android with Nextcloud for 1 1/2 years now with the same password.

@kai-uwe-rommel
Copy link

When we created a Keepass db for one of my sons today and were trying to open it from our Synology NAS via WebDAV, we also encountered this problem. He has german umlauts in his password.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests