semaphore: v2.9.56 breaks oidc auth with keycloak
When updating from v2.9.45 to v2.9.56, our existing integration with keycloak breaks.
The error shown in the docker logs is time="2024-03-24T17:38:23Z" level=error msg="oauth2: \"invalid_grant\" \"Code not valid\"". On the UI side, signing in with SSO just returns you to the login page but does not actually log the user in.
A downgrade to 2.9.45 fixes the issue.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 39 (1 by maintainers)
Thank you @fiftin. Very generous of you to provide this quick solution. adding the
redirect_urlfixed it. Just curious how is it different from omitting theredirect_urland letting it use the default as suggested in the doc:${web_host}/api/auth/oidc/${provider}/redirect, shouldn’t this expand to the same value as long as web_host is defined correctly? did the behaviour of the default values changed in the newer versions?i’ve in my config:
web_host: https://semaphore.example.comredirect_url: https://semaphore.example.com/api/auth/oidc/okta/redirect@rsch136 looks like you have broken config. Please check that you have
cookie_hashin your config file orSEMAPHORE_COOKIE_HASHenvironment variable. It must be generated by commandhead -c32 /dev/urandom | base64.Sorry @fiftin deployment is done and the service has been restarted. It’s also fixed now for us. Thanks for your work.
@fiftin sorry for the delay. I copied the relevant error from our authentik-backend:
I’m just deploying the new version of ansible-semaphore to check if it is already fixed.
I have updated to 2.9.65 and all is working fine for me
@fiftin we were following this docu: https://docs.semui.co/administration-guide/openid
Didn’t previously have any issue with cookie hashes. Do you have a link?
My semaphore config below, then screen grabs of Keycloak. let me know if you need anything else
Hmm everything over v2.9.45 seems to also break oidc with authentik as IDP. Here is the relevant part of our
config.json