saber icon indicating copy to clipboard operation
saber copied to clipboard

App does not sync with clouds that have 2FA.

Open GuiSousa135 opened this issue 1 year ago • 5 comments

Before submitting an issue, please check the following

  • [X] I have searched for similar issues (both open and closed) and cannot find a duplicate
  • [X] I agree to follow the Code of Conduct

Describe the bug

App notes do not sync with cloud services that have second factor authentication (2FA OTP), this applies to both default server and the custom servers.

To reproduce

  1. Enable the second authentication factor on your Nextcloud account.

  2. Log in with the Saber app (using only the default fields).

  3. Look at the error message.

Expected behavior

If the cloud (whether the standard server or a custom server) that the user wanted to synchronize the notes with has some type of second authentication enabled, the application cannot access the service with just the password. The ideal would be to have another numeric field in the login area to add the second authentication factor, this way the application would be able to log in to Nextcloud clouds.

Saber version

V 0.19.3 F-Droid.

Device

  • Device: Samsung Tab S6 Lite

  • OS: Android 12L

  • Device: Samsung Galaxy S20 FE

  • OS: Android 12

  • Device: Google Pixel 6

  • OS: Android 13

Anything else?

Tested on multiple devices with the latest versions of the Saber app, both with the default server and custom Nextcloud servers.

GuiSousa135 avatar Feb 11 '24 18:02 GuiSousa135

Sync works normally on servers without 2FA OTP, but it would be great to have the option to sync with more secure account servers.

GuiSousa135 avatar Feb 11 '24 18:02 GuiSousa135

Did you read comments nextcloud connection setup (down on screen)?

Instead of your regular Nextcloud password, you'll need to create an "app password". You can do this in your Nextcloud settings under Security > Devices & sessions > Create new app password. Your encryption password is unaffected.

I have no 2FA so I cannot check how it works.

QubaB avatar Feb 13 '24 18:02 QubaB

I completely agree with @QubaB. I have a Nextcloud instance with 2FA and logging in into Saber using app password works just fine.

ceskyDJ avatar Feb 17 '24 07:02 ceskyDJ

I did not know about this functionality of Nextcloud, I thank you for the clarification, now the synchronization is working normally, but there is still the tip of this functionality for Saber, it would also be welcome.

GuiSousa135 avatar Feb 20 '24 11:02 GuiSousa135

I agree. Saber (like other apps working with Nextcloud) shouldn't use account passwords for logging in into Nextcloud at all. It should retrieve app passwords instead. @adil192, could you look at it, please? Here is a Nextcloud documentation page about this problem: https://docs.nextcloud.com/server/latest/developer_manual/client_apis/LoginFlow/index.html.

ceskyDJ avatar Feb 20 '24 15:02 ceskyDJ

Closed with https://github.com/saber-notes/saber/pull/1246

adil192 avatar Jun 25 '24 01:06 adil192