saber icon indicating copy to clipboard operation
saber copied to clipboard

OAuth with own nextcloud server fails silently

Open Lattay opened this issue 1 year ago • 4 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

When trying to connect to a Nextcloud server other than the official Saber one, the process goes normally, but when the procedure is done on the browser side nothing happen in the app.

I got this on android and with the flatpak version on linux, however the linux version let me run in a terminal and I get this exception:

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Deserializing to 'UsersGetCurrentUserResponseApplicationJson' failed due to: Deserializing to 'UsersGetCurrentUserResponseApplicationJson_Ocs' failed due to: Deserializing to 'UserDetails' failed due to: Tried to construct class "UserDetails" with null for non-nullable field "displayname".
#0      BuiltJsonSerializers._deserialize (package:built_value/src/built_json_serializers.dart:180)
#1      BuiltJsonSerializers.deserialize (package:built_value/src/built_json_serializers.dart:125)
#2      _deserialize (package:dynamite_runtime/src/client/response.dart:203)
#3      ResponseConverter.convert (package:dynamite_runtime/src/client/response.dart:143)
<asynchronous suspension>
#4      $UsersClient.getCurrentUser (package:nextcloud/src/api/provisioning_api.openapi.dart:3168)
<asynchronous suspension>
#5      NextcloudClientExtension.getUsername (package:saber/data/nextcloud/nextcloud_client_extension.dart:147)
<asynchronous suspension>
#6      _NcLoginStepState.startLoginFlow.<anonymous closure> (package:saber/components/nextcloud/nc_login_step.dart:54)
<asynchronous suspension>

To reproduce

  1. In settings go to click on the account button
  2. Fill the "other nextcloud server" field
  3. Click connect
  4. Follow the steps in the browser
  5. At the end nothing happen

Expected behavior

Connection is validated.

Saber version

v0.24.3

Device

  • Device: Samsung S8

  • OS: Android 9

  • Device: Linux laptop

  • OS: Arch linux

Anything else?

The Nextcloud server is outdated, running 24.0.12. I don't have the possibility to update the server. If this project cannot support older servers it would be nice to have a mention of the minimum server requirement in the README.

Lattay avatar Jul 29 '24 12:07 Lattay

Same here on Android 9 with a Samsung Galaxy Note 8, Nextcloud 25.0.13. I treid with an app-token as well as with the default authentication method. Saber doesn't tell me anything why it fails.

huste avatar Oct 30 '24 17:10 huste

Same issue on Samsung Galaxy A35, NextCloud 26.0.13

xxfogs avatar Jan 27 '25 13:01 xxfogs

I've noticed something. If I remove TLS and use HTTP protocol instead, everything works just fine.

Perhaps the wrong protocol is being supplied in the OAuth requests?

xxfogs avatar Jan 29 '25 10:01 xxfogs

I have the same issue on Mac and iOS (iPad, iPhone).

viktoriakeller avatar Apr 15 '25 07:04 viktoriakeller