I recently tried to set up openid authentication for keycloak authentification on my dolibarr but the links to create by hand in “MAIN_AUTHENTICATION_OPENID_URL” do not work and mark me after signin in with keycloak “You requested a website or a page that does not exist. »
My link seems well configured looks like :
I am trying Openid against authentik, but also had no luck.
I wonder if urlencoding is needed, the documentation looks like only the redirect_uri needs to be urlencoded and the following paramters not.
But, tried nearly every combination without success
Add the following global variables in Home > Setup > Others:
MAIN_AUTHENTICATION_OIDC_CLIENT_ID:
your-keycloack-client-id
MAIN_AUTHENTICATION_OIDC_CLIENT_SECRET
your client secret
MAIN_AUTHENTICATION_OIDC_LOGIN_CLAIM (I had to add it because in my version the matching is done through the user name instead of the email address)
preferred_username
MAIN_AUTHENTICATION_OIDC_REDIRECT_URL
https://your-dolibarr-url-web/?openid_mode=true
MAIN_AUTHENTICATION_OIDC_TOKEN_URL
https://your-keycloack-url/auth/realms/your-keycloack-realm/protocol/openid-connect/token
MAIN_AUTHENTICATION_OIDC_USERINFO_URL
https://your-keycloack-url/auth/realms/your-keycloack-realm/protocol/openid-connect/userinfo
MAIN_AUTHENTICATION_OPENID_URL
https://your-keycloack-url/auth/realms/your-keycloack-realm/protocol/openid-connect/auth/?client_id=your-keycloack-client-id&redirect_uri=https%3A%2F%2Fyour-dolibarr-url-web%2F%3Fopenid_mode%3Dtrue&scope=openid+profile+email&response_type=code&tz=1
MAIN_LOGOUT_GOTO_URL
https://your-keycloack-url/auth/realms/your-keycloack-realm/protocol/openid-connect/logout?client_id=your-keycloack-client-id&post_logout_redirect_uri=https%3A%2F%2Fyour-dolibarr-url-web
I guess, that the Keycloack part is well configured.
You will have to create a user in keycloack whose username matches the username in Dolibarr.
PD: My dolibarr runs on Apache (Nginx was giving me problems)