oAuth2 Callback URL not working with Authentik SSO


I can’t seem to authenticate against Authentik using oauth.

I get sent to Authentik to login, which I do successfully. It then redirects back to Vikunja successfully, but I get the following browser error:

And Vikunja error:

2022-09-29T17:35:08.984790153Z: ERROR   ▶ openid/HandleCallback 09e oauth2: cannot fetch token: 400 Bad Request
Response: {"error": "invalid_client", "error_description": "Client authentication failed (e.g., unknown client, no client authentication included, or unsupported authentication method)"}

This is the error in the backend’s logs.

The client ID and secret both match in my SSO and Vikunja, I’ve checked this numerous times and even redone is on the SSO side, with new client ID’s and secrets. However, if I change the client ID, when I browse to the login page and try to login via oAuth, Vikunja tries to refer me back to my SSO provider with the old client ID?

Bahhh!! So frustrating.

It turns out this was an issue with redis caching.