dashy icon indicating copy to clipboard operation
dashy copied to clipboard

[BUG] Infinite loop with Keycloak 21.0.1

Open JPVenson opened this issue 2 years ago • 9 comments

Environment

Self-Hosted (Docker)

System

No response

Version

2.1.0

Describe the problem

After i was forced to recreate my container due to the whole Authentication not working with 2.1.1, i found out that with keycloak 21.0.1 and Dashy 2.1.0 the app gets in an Infinite cycle loading due to the token endpoint returning 401 after logging in.

This might be due to a misconfiguration on keycloak side but in any case the app should never just endless refresh on an Authentication error.

Additional info

image

Please tick the boxes

JPVenson avatar Mar 06 '23 21:03 JPVenson

If you're enjoying Dashy, consider dropping us a ⭐
🤖 I'm a bot, and this message was automated

liss-bot avatar Mar 06 '23 21:03 liss-bot

This issue has gone 6 weeks without an update. To keep the ticket open, please indicate that it is still relevant in a comment below. Otherwise it will be closed in 5 working days.

liss-bot avatar Apr 06 '23 01:04 liss-bot

It is still relevant, I have the same problem with version 21.0.2

juantxorena avatar Apr 07 '23 17:04 juantxorena

I thought I could research this bug: I updated the keycloak-js to the latest one, 21.0.2, with no success. The events in keycloak show some errors, I attach a screenshot: Screenshot_20230408_134209

I have other apps that login with keycloak and they work correctly. However, I don't think they implement something keycloak specific, just generic oidc stuff. This is the query to the keycloak server of one of them, vikunja

https://auth.lan:8443/realms/zuhause/protocol/openid-connect/auth?client_id=vikunja&redirect_uri=https://projekt.lan/auth/openid/keycloak&response_type=code&scope=openid email profile&state=ysuarxd4iha

Dashy first (successfully, 200) tries to call this: https://auth.lan:8443/realms/zuhause/protocol/openid-connect/3p-cookies/step1.html

Then this, and keycloak returns a 302: https://auth.lan:8443/realms/zuhause/protocol/openid-connect/auth?client_id=dashy&redirect_uri=http%3A%2F%2Fzuhause.lan%3A4000%2F&state=3eec92a5-008e-4857-8251-cab38ae69a0f&response_mode=fragment&response_type=code&scope=openid&nonce=1d96b9f0-7d64-4231-8981-08fadf1e4f90

Then it loads some icons and css and stuff, and dashy tries to communicate again with the keycloak server, this one getting a 401 and reloading again in an infinite loop:

https://auth.lan:8443/realms/zuhause/protocol/openid-connect/token

Legend:

  • keycloak server: https://auth.lan:8443
  • keycloak realm: zuhause
  • vikunja server: https://projekte.lan
  • dashy server: http://zuhause.lan:4000

juantxorena avatar Apr 08 '23 11:04 juantxorena

Of course, it was my fault. I had set Client authentication in the config of the keycloak config. Now it's off, and working. Maybe a working config of the client would be useful for the documentation?

juantxorena avatar Apr 08 '23 16:04 juantxorena

If you can post an example of a working client it would be nice. Actually running dashy 2.1.0 + keycloak 21.0.2 and i'm facing the same problem The client is configured with Client authentication and Standard Flow

thelan avatar Apr 11 '23 09:04 thelan

I'll put it when I'm at home, but client authentication has to be off

juantxorena avatar Apr 11 '23 09:04 juantxorena

Sorry for the late reply. Config, assuming that the dashy URI is dashy.example.com:

Root URL: https://dashy.example.com/ Home URL: https://dashy.example.com Valid redirect URIs: https://dashy.example.com/* Web origins: https://dashy.example.com

Capability config: everything off/unchecked except "Standard flow", "Direct access grants" and "Implicit flow"

I didn't touch anything else.

juantxorena avatar Apr 16 '23 14:04 juantxorena

No wories. I've tested with your settings but it's still looping on the auth.

From the keycloak side in the event logs everything is ok.

Did you add specific roles in the keycloak client config ?

Did you rebuild the container or did you use it for the docker hub ?

thelan avatar Apr 17 '23 19:04 thelan

This issue has gone 6 weeks without an update. To keep the ticket open, please indicate that it is still relevant in a comment below. Otherwise it will be closed in 5 working days.

liss-bot avatar May 19 '23 01:05 liss-bot

This issue was automatically closed because it has been stalled for over 6 weeks with no activity.

liss-bot avatar May 24 '23 01:05 liss-bot