vauvenal5 / yaga

Nextcloud Yaga - A Nextcloud first gallery app for Android.
https://vauvenal5.github.io/yaga-docs/
GNU General Public License v3.0
137 stars 10 forks source link

0.15.10 log in stays in the browser #35

Closed Leptopoda closed 3 years ago

Leptopoda commented 3 years ago

signal-2020-12-28-225930

I can successfully log in but it stays on the sign-in activity with the mobile site of my nextcloud (browser). I'm on lineageos 17.0 with the fdroid build of this app

vauvenal5 commented 3 years ago

I will have a look. However, I have currently no idea what could be the reason. Can you also provide your Nextcloud server version?

vauvenal5 commented 3 years ago

Are you signed in if you manually navigate back in the app?

Leptopoda commented 3 years ago

I'm on 20.0.4-snap1 I navigated back and I was not signed in. When I opened the sign in page I had to re specify my domain (seems like cookies where preserved an I only hat to 'allow access to this client' [login flow2]) I did not have to enter my username or password. Now it works fine ....

vauvenal5 commented 3 years ago

Hmm. Has probably something to do with the Flutter webview. I could not reproduce the issue on my lineageos device. I will leave the issue open for the time being.

facorazza commented 3 years ago

I had the same issue. Could it be the 2FA that interferes with the login flow?

Leptopoda commented 3 years ago

I can consistently reproduce it with my acccunt (and yes I use 2fa)

I tested yesterday with a different account on a different device and it worked (this account didn't use 2fa)

I'll test with this second account on my device later ... I can consistently reproduce this on my device no matter if with or without 2fa FYI I don't use play services don't know why it should matter though.

I'll catch some logcat tomorrow (if I get the time)

vauvenal5 commented 3 years ago

2FA should not be the issue since I am using 2FA in my setup without any issues. If you find something useful in the logs let me know.

Maybe I should consider switching the login flow to the browser based flow, however, this is something that will require some more time.

Leptopoda commented 3 years ago

What about using the account provided by the nextcloud app? Off course this would need the presence of the nc app but it's already needed for auto upload ...

vauvenal5 commented 3 years ago

This idea is being tracked in #3. I will have to evaluate the different options and the time they will require.

Leptopoda commented 3 years ago

Sadly I can't reproduice it anymore ... but it happened at least once while logging :) I was not able to find any usefull information though. The log is attached as a file. I also digged into my nextcloud.log (without success) My nginx access log showed:

[30/Dec/2020:21:03:59 +0100] "POST /index.php/login/challenge/totp?redirect_url=/index.php/login/flow/grant?clientIdentifier%3D%26stateToken%3DJMKIfUqfxetssqrMLRxx1lHYlCpuSMVhwag9qg71CXGyNe7KJcscprPeJo04deIW HTTP/2.0" 303 0 "https://example.com/index.php/login/challenge/totp?redirect_url=/index.php/login/flow/grant?clientIdentifier%3D%26stateToken%3DJMKIfUqfxetssqrMLRxx1lHYlCpuSMVhwag9qg71CXGyNe7KJcscprPeJo04deIW" "Nextcloud Yaga"
[30/Dec/2020:21:03:59 +0100] "GET /index.php/apps/files/ HTTP/2.0" 200 9493 "-" "Nextcloud Yaga"
[30/Dec/2020:21:04:00 +0100] "POST /index.php/login/challenge/totp?redirect_url=/index.php/login/flow/grant?clientIdentifier%3D%26stateToken%3DJMKIfUqfxetssqrMLRxx1lHYlCpuSMVhwag9qg71CXGyNe7KJcscprPeJo04deIW HTTP/2.0" 303 0 "https://example.com/index.php/login/challenge/totp?redirect_url=/index.php/login/flow/grant?clientIdentifier%3D%26stateToken%3DJMKIfUqfxetssqrMLRxx1lHYlCpuSMVhwag9qg71CXGyNe7KJcscprPeJo04deIW" "Nextcloud Yaga"
[30/Dec/2020:21:04:01 +0100] "GET /index.php/apps/files/ HTTP/2.0" 200 9495 "-" "Nextcloud Yaga"
[30/Dec/2020:21:04:01 +0100] "GET /apps/notifications/l10n/de.js?v=fcaf63af HTTP/2.0" 200 918 "https://example.com/index.php/apps/files/" "Nextcloud Yaga"

The 303 response to the POST request should redirect the client but still the following request is for the nextcloud files web UI I'd expect something accessing webdav like

"PROPFIND /remote.php/dav/files/me/ HTTP/1.1" 207 665 "-" "Dart/2.10 (dart:io)"

EDIT: i forgot to attach the log xD yaga1.log

vauvenal5 commented 3 years ago

I will check it out, however, this is not a high priority issue for me since you were able to login in the end. Most likely the issue is connected either with the Flutter webview, which itself went into first stable release a few months ago, or with the missing play services, although I can not currently think of why that should matter. I will also consider if rewriting the login flow won't make this issue obsolete. Thx for the research so far :smiley:

vauvenal5 commented 3 years ago

I found the issue by chance. It is fixed in v0.17.5.