r/KeyCloak • u/FootballRemarkable53 • Sep 21 '26
Using Keycloak with LDAP users as authentication for Odoo?
I am currently in the process of setting up Keycloak with LDAP as a log in option for Odoo - I can log into the keycloak realm without issue but I get
You do not have access to this database or your invitation has expired. Please ask for an invitation and be sure to follow the link in your invitation email.
The user's email exists as an account inside Odoo, and the emails match properly. Any idea what could be going on here? I have attached my Odoo keycloak config as well.

8
Upvotes
1
u/MLabs-Haskell Oct 05 '26
Odoo never matches an OAuth login on email. In Odoo 17's OAuth module, the sign-in code looks the user up by OAuth user ID plus provider, and nothing else. If that finds no one, it tries to sign up a new user. When that fails, because signup is off or the login already exists (your case), it raises AccessDenied. The controller turns that into
oauth_error=3, which is exactly the "invitation has expired" text you're seeing.So the matching emails never come into it. Two ways out.
subfirst, and in Keycloak that's the ID on the user's Details page. The LDAP username and the email play no part.With more than a handful of users, option 1 is easy to script over XML-RPC against res.users.