app icon indicating copy to clipboard operation
app copied to clipboard

Imposible to login in 0.1.6

Open artromone opened this issue 1 year ago • 3 comments

Cant login in both frontend and app in 0.1.6.

Nothing happens in app when i put down the mail, password, auth code and press continue. Frontend just clothes and also nothing happens.

Could login in 0.1.5.

artromone avatar Jul 27 '24 12:07 artromone

What version is your API? Can you log in to https://try.vikunja.io with username demo and password demo?

Benimautner avatar Aug 04 '24 23:08 Benimautner

I had a report via mail where a user has the same problem. They provided logs from their device:

08-28 13:13:29.759 32259 32259 E chromium: [ERROR:aw_browser_terminator.cc(166)] Renderer process (32418) crash detected (code -1).
08-28 13:15:17.733 32616 32616 E io.vikunja.app: Not starting debugger since process cannot load the jdwp agent.
08-28 13:15:17.802 32616 32616 E cutils-trace: Error opening trace file: No such file or directory (2)
08-28 13:15:17.939 32616 32616 E io.vikunja.app: Unable to find pattern file or unable to map it for am
08-28 13:15:18.005 32616 32616 E TAG     : test

I suspect the problem is caused by the way we're using to grab the token from the browser session, which is probably not the most ideal. Mid-term, we should change the login to use a proper oauth process with a custom protocol.

kolaente avatar Aug 29 '24 12:08 kolaente

We should move to proper oauth, yes. I didn't like the idea before, because that would break backwards compatibility, but since the app isn't backwards compatible anymore due to api changes anyways, I'm happy to implement oauth if the API supports it.

Benimautner avatar Sep 13 '24 19:09 Benimautner

"Cant login in both frontend and app in 0.1.6." Are you saying you also can't log into the web frontend in a normal browser?

Benimautner avatar Sep 26 '24 11:09 Benimautner

"Cant login in both frontend and app in 0.1.6." Are you saying you also can't log into the web frontend in a normal browser?

Not OP, but I although I am able to login via a regular regular browser, I can't through the android app, whether via its login form or the "Login with Frontend" button.

This also happens on 0.1.7 here, and last working version for me was 0.1.5

aleprovencio avatar Sep 27 '24 10:09 aleprovencio

Can you confirm which api version you're on and whether https://try.vikunja.io works?

Benimautner avatar Sep 27 '24 11:09 Benimautner

I'm running Vikunja Version: v0.24.3 on my server, hope you can infer API version from it. Yes, I did try the try.vikunja.io , and issue remains if doing that from the app

aleprovencio avatar Sep 27 '24 11:09 aleprovencio

So when you enter "https://try.vikunja.io" as a server address and "demo" as username and "demo" as password the login doesn't work? Please try to reinstall the app. (Completely uninstall, then reinstall the latest version) I can't reproduce this at all and @kolaente 's logs are for the webview only, not for the regular login.

Benimautner avatar Oct 01 '24 18:10 Benimautner

@Benimautner , just did that with 0.1.8-beta and still no luck

aleprovencio avatar Oct 02 '24 11:10 aleprovencio

Did you get the automatic error reporting popup and did you enable it when you started the app? What android version are you on and what phone do you have?

Benimautner avatar Oct 02 '24 11:10 Benimautner

@aleprovencio I think I figured it out, please download the build and test it from the workflow: https://github.com/go-vikunja/app/actions/runs/11143253709/artifacts/2005599919

let me know if you have access to that link.

Benimautner avatar Oct 02 '24 12:10 Benimautner

When is the user id null?

kolaente avatar Oct 02 '24 12:10 kolaente

I will dig into that after I have confirmation that that actually is the problem :)

Benimautner avatar Oct 02 '24 12:10 Benimautner

Did you get the automatic error reporting popup and did you enable it when you started the app? What android version are you on and what phone do you have?

Yes I'm allowing error reporting to Sentry, and I'm running GrapheneOS.

@aleprovencio I think I figured it out, please download the build and test it from the workflow: https://github.com/go-vikunja/app/actions/runs/11143253709/artifacts/2005599919

let me know if you have access to that link.

Just tried this build and ... no good

However, all my tests were based on a profile without Google Play Services, so I have created one separate profile with Play Services installed and ... It worked 😄 Just keep in mind that version 0.1.5 works on my main profile OK

Hope we are closer to fix this

aleprovencio avatar Oct 02 '24 12:10 aleprovencio

Ahh GrapheneOS might be the culprit. That's also the reason sentry isn't reporting android version and build for your errors :'). I'll look into it some more and might ping you with new builds. Unfortunately I can't easily run grapheneos locally since I'd have to build a separate image for the emulator.

Benimautner avatar Oct 02 '24 12:10 Benimautner

No problems @Benimautner , and count on me trying to help somehow.

Another heads up, I tried running this app with GrapheneOS's exploit protections off, and issue stays OK

aleprovencio avatar Oct 02 '24 12:10 aleprovencio

@aleprovencio I've been looking at the changes from 0.1.5 to 0.1.6 and I might have an idea where the issue is coming from. Can you monitor the vikunja api logs ("docker compose logs" if you're running in docker) and check whether you're getting these or a similar kind of message?

POST 200 /api/v1/login 139.281993ms - Vikunja Mobile App GET 200 /api/v1/user 1.449595ms - Vikunja Mobile App

Benimautner avatar Oct 03 '24 08:10 Benimautner

@aleprovencio please download the apk from the pipeline and send a screenshot of the vikunja login screen: https://github.com/go-vikunja/app/actions/runs/11158948280/artifacts/2009979413

Benimautner avatar Oct 03 '24 09:10 Benimautner

When trying to log into my own server, I don't get a POST 200 /api/v1/login 139.281993ms - Vikunja Mobile App, but I do on the GET 200 /api/v1/user 1.449595ms - Vikunja Mobile App:

1  GET 200 /api/v1/user 3.153531ms - Mozilla/5.0 (Linux; Android 14; Pixel 6a Bu
ild/AP2A.240905.003.F1; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome
/129.0.6668.70 Mobile Safari/537.36 2024-10-03T10:02:00.905142575-03:00 2024-10-03T10:02:00-03:00: WEB

I'm unsure if this is the screenshot you asked for, but here you go Screenshot_20241003-100456

aleprovencio avatar Oct 03 '24 13:10 aleprovencio

@kolaente is there any way to get a 200 response on /user without being logged in?

@aleprovencio did you install the newest build? There should be a "platform:" string at the bottom (see attached)

Screenshot_20241003-151529_Vikunja.png

Benimautner avatar Oct 03 '24 13:10 Benimautner

I don't know what kind of mess I did but I was not on this build, new screenshot confirms.

I still don't a get a POST 200 /api/v1/login 139.281993ms - Vikunja Mobile App, but now I get the following message that was not on logs before:

1  GET 200 /login 679.812µs - Mozilla/5.0 (Linux; Android 8.0; Pixel 2 Build/OPD
3.170 816.012) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.82 Mobile Safari/537.36 2024-10-03T10:30:27.254988899-03:00 2024-10-03T10:30:27-03:00: WEB

Screenshot_20241003-102544

aleprovencio avatar Oct 03 '24 13:10 aleprovencio

wtf. there should be no way the app triggers a get on /login (especially because that's not even an api endpoint). Also, the user agent should be "Vikunja Mobile App". are you clicking on "Login with frontend" when that log gets triggered? i might as well build the GrapheneOS emulator image myself tonight. i'll let you know. could you do me one last favor and test 0.1.5? I don't expect it to work past the login page, but you should at least get to the next view..

Benimautner avatar Oct 03 '24 13:10 Benimautner

Just tried again v0.1.5, and it just works. The demo site works fine even without going with login with frontend but to login on my own instance, I have to use it because vikunja is behind authelia's 2FA. I put my credentials and it leads me back to the login page, then I click on Login with authelia and I'm in.

aleprovencio avatar Oct 03 '24 14:10 aleprovencio

Finally fixed it. After compiling the graphene emulator image (because for whatever reason they can't just build and distribute it), I finally figured out that GrapheneOS's support of cronet (which we have been using since 0.1.6 because it allows us to access the certificate store on android) is either broken or intentionally not working. And it did throw errors, but for some reason it did not display them, only printed them to the console. Anyways, after adding a fallback catch it is working (at least in my GrapheneOS emulator). Please try it (one last time :) ):

https://github.com/go-vikunja/app/actions/runs/11192045404/artifacts/2018878158

Disclaimer: If you are using a custom certificate on your server this might not work, but I'd have to dig deeper for that, and I suspect there is no easy fix on graphene because of its security features.

Benimautner avatar Oct 05 '24 09:10 Benimautner

It does work, you got it @Benimautner !

Please let me know you if need further help testing grapheneos stuff OK

aleprovencio avatar Oct 05 '24 14:10 aleprovencio