notes-android icon indicating copy to clipboard operation
notes-android copied to clipboard

Latest F-Droid Android app does not support MFA with TOTP

Open dnaod opened this issue 3 years ago • 10 comments

Please use GitHub reactions 👍 to show that you are affected by the same issue. Please don't comment if you have no relevant information to add!

Describe the bug

Using the latest F-Droid version of the NextCloud Notes app (3.5.00), when logging in to a NextCloud account that's enabled TOTP MFA, an error dialog is displayed.

Your Nextcloud Files app currently does not support the single sign on feature. Please update it: https://play.google.com/store/apps/details?id=com.nextcloud.client

and a toast is also displayed that reads

Attempt to invoke virtual method 'java.lang.String android.content.intent.getStringExtra(java.lang.String)' on a null object reference

To Reproduce Steps to reproduce the behavior:

  1. Ensure you have an existing NextCloud server with the Notes app and Two-Factor TOTOP Provider apps installed and active.
  2. Ensure you have an existing NextCloud user who has activated TOTP MFA on their account.
  3. Ensure that you have already installed the NextCloud android app from F-Droid and logged into your existing account.
  4. Install the F-Droid NextCloud Notes app (v 3.5.00) on the Android app.
  5. Open the NextCloud Notes app on the Android app.
  6. At the 'Welcome To Notes' page, select 'CHOOSE ACCOUNT'
  7. At the 'Choose an account' page, select the account that you have already logged into in the NextCloud android app.
  8. Error describe above is shown.

Expected behavior

Either you are immediately logged in or prompted to enter some additional credentials to be authenticated. App is now considered logged in and continues to the next step.

Screenshots

image

Smartphone (please complete the following information):

  • Nextcloud Notes-Version (android app): 3.5.00
  • F-Droid or Play Store: F-Droid
  • Android-Version: Lineage 18.1 Android 11 (no gapps!)
  • Device: Moto G(5) (Osprey)

Server

  • Nextcloud version: 23.0.2.1
  • Nextcloud Notes version (server app): 4.3.1

Stacktrace

dnaod avatar Jul 07 '22 17:07 dnaod

Screenshot_20220707-092656_Nextcloud_Notes (1).png

dnaod avatar Jul 12 '22 17:07 dnaod

Which version of the Nextcloud Android App (not Notes Android) are you using? From F-Droid, i guess? The Dev or the stable release? Which version exactly?

Does the Nextcloud Android app prompt you any message if you open it?

stefan-niedermann avatar Jul 13 '22 08:07 stefan-niedermann

Looks like NextCloud Android App version 20220702 from F-Droid. Looks like there's been two updates since I last looked I'll update it now.

Logged in, when opening the NextCloud app, there's no prompts. When I first installed the NextCloud app, I went through a normal connection and login flow with no issues.

dnaod avatar Jul 13 '22 18:07 dnaod

I can confirm that the upgraded 20220713 version from F-Droid exhibits the same issue as above.

dnaod avatar Jul 13 '22 20:07 dnaod

Would you please clear the storage of the apps as described in our FAQ to ensure that anything has a clear state?

Could you also please try the Deck Android App or News Android App (both free on F-Droid) to check whether this is an issue with Notes itself or with the Single-Sign-On-Feature?

stefan-niedermann avatar Jul 14 '22 05:07 stefan-niedermann

As requested

  1. Cleared the data of NextCloud app and NextCloud Notes.
  2. Logged back into NextCloud app using username, password, and MFA.
  3. Opened NextCloud Notes app and selected above account. Same error (as original screenshot).
  4. Installed NextCloud Deck.
  5. Opened NextCloud Deck app and selected above account.

Your NextCloud Files app currently does not support the single sign on feature. Please update it: https://play.google.com/store/apps/details?id=com.nextcloud.client

But NO error toast on NextCloud deck.

Next Test

  1. Cleared the data of NextCloud app, NextCloud Notes, and NextCloud Deck
  2. Logged back into NextCloud app but used QR code generated from NextCloud web app under Settings > Security > Devices & Settings
  3. Opened NextCloud Notes app and selected above account. Same error (as original screenshot).

Additional considerations

  • I am using Wireguard and an internal ip address for the server connection. Could this be related?

dnaod avatar Jul 15 '22 17:07 dnaod

cc @David-Development - any idea? Looks like a general SSO issue rather than an issue with the Notes app...

stefan-niedermann avatar Jul 17 '22 11:07 stefan-niedermann

+1, can confirm.

I use a degoogled LineageOS on vayu, experiencing the same issue.

karolyi avatar Jul 18 '22 12:07 karolyi

@stefan-niedermann From what I can see you are not using the Nextcloud Files Version check, right? (check if a specific or newer version of the files app is installed). So the only other time when this exception (NextcloudFilesAppNotSupportedException) is raised would be if the Account Chooser can't be opened (here) or if the Token Exchange fails. According to @dnaod steps to reproduce I assume that it fails in the Token Exchange part - so the call to authenticateSingleSignAccount

@dnaod Just to clarify - we are talking about the Dev or Prod Version here? They have a different package name and this might be causing the issue as I had a similar report in the News Repo the other day.

Just double checked - the version codes with just a date are for the beta (https://f-droid.org/en/packages/com.nextcloud.android.beta/) while actual version numbers are for the prod version (https://f-droid.org/packages/com.nextcloud.client/)

David-Development avatar Jul 18 '22 17:07 David-Development

@David-Development got it. I didn't realize that there was a dev and prod version for NextCloud on F-Droid. The only indicator is buried down at the bottom of the description of the dev version. Additionally, the prod version is much further down the search results list if you search for "Next..." in F-Droid.

Turns out I've installed the dev version on all my mobile devices.

Once I installed the prod version, NextCloud Notes worked as expected. I would consider this issue closed unless it needs to be fixed for dev.

Much thanks.

dnaod avatar Jul 18 '22 20:07 dnaod

Closing this issue in favor of the linked upstream issue

stefan-niedermann avatar Aug 07 '22 08:08 stefan-niedermann