PocketID and Android App Error

Just setup PocketID with Vikunja.

Works fine on my pc browser.

Works find on my android browser.

When using the app I enter my user and then select to login via the frontend. Browser opens but generic something went wrong error with pocket id. If I generate a code in PocketID I can login that way and it takes me back to the app. I can navigate around ok.

If I close the app and open it again I get:

type ‘String’ is not a subtype of type ‘Map<String,dynamic>?’

Check this issue for details: bug - async error · Issue #204 · go-vikunja/app · GitHub

Hey. I’d actually ran into that one before

I’ve been on the unstable version since then and have been keeping it updated. All has worked great until I implemented the oauth and tried the app.

I just re-enabled local auth, cleared the app cache and confirmed I can login with my original “local” user. I logged in solely with the app.

I then logged out and tried the front end option. This gave me the error (while on the login screen) of ‘this account is managed by a third-party authentication provider’

That may just be some confusion with account names due to me having a local and then adding an oauth one and not super relevant.

Was playing around some more.

Deleted all vikunja users

Disabled local auth

Logged in with my pocketid auth in the pc browser - created user and all looks good

Tried to login with the Android app (using frontend option)

Got ‘unknown error occurred’

Looked at my pocket id logs in docker and clicked the hyperlink it’s trying to auth with.

That gave me:

State does not match, refusing to continue!

I see this message is in the vikunja codebase so may provide some idea? Or using the url directly may just not work and this is a bad test.

If you’re using a third-party auth provider, you’ll need to use the “Login with frontend” option. This is a little confusing but we’re working on that.

It made sense to me :slight_smile:

But that’s what got me to this error:

The fact I had to use a code because PocketID was giving me the ‘unknown error has occurred’ no doubt has something to do with it.

Is there something special I need to add in my oauth client to handle the mobile app? Again, all works great from the browser.

Huh as long as it works in the browser and you’re using the „Login with frontend“ option, it should work fine, because in that case the app is using the frontend to log in (as the name implies). It might be related to something with cookies or such because the web view that’s used by the app when logging in with the frontend might be more restricted than a browser.

I probably should mention I am using the environment config in the compose file. I assume it’s all good since the browser is working.

VIKUNJA_AUTH_LOCAL_ENABLED: false
VIKUNJA_AUTH_OPENID_ENABLED: “true”
VIKUNJA_AUTH_OPENID_PROVIDERS_POCKETID_AUTHURL: ``https://id.example.com
VIKUNJA_AUTH_OPENID_PROVIDERS_POCKETID_CLIENTID: xxxxxxxxxx
VIKUNJA_AUTH_OPENID_PROVIDERS_POCKETID_CLIENTSECRET: xxxxxxxxxxxxxx
VIKUNJA_AUTH_OPENID_PROVIDERS_POCKETID_NAME: PocketID
VIKUNJA_AUTH_OPENID_PROVIDERS_POCKETID_SCOPE: “openid profile email”

Unstable release

Pocket ID callback url:

https://tasks.example.com/auth/openid/pocketid

Anyone here using pocket ID and the android mobile app?

Looked some more today and config seems fine (and still working with web) so seems like it has to be something in the Android App itself or the ‘frontend login’.

Asked on the pocketid GH also: Vikunja client isn't working with the android app · pocket-id/pocket-id · Discussion #1237 · GitHub