Odoo
This guide explains how to connect Odoo Community (versions 18 and 19) to VaultysHub using OpenID Connect, with the free module auth_oidc from OCA (Odoo Community Association).
The standard Odoo module, OAuth Authentication (auth_oauth), only requires a direct access token (response_type=token), which VaultysHub does not provide. auth_oidc adds the authorization code flow with PKCE, and verifies the identity token's signature with VaultysHub's public keys.
Prerequisites
- Odoo Community 18 or 19, served over HTTPS (e.g.,
https://odoo.example.com) - The
auth_oidcmodule (branch18.0or19.0of OCA/server-auth) in the addons path, and the Python librarypython-jose - Administrator access to Odoo and VaultysHub
Configuration in VaultysHub
- Applications → Add: name Odoo, URL
https://odoo.example.com/web/login - Type OIDC, then:
- Redirect URI:
https://odoo.example.com/auth_oauth/signin - Allowed scope:
openid,email,profile - Subject identifier (sub): Email address
- Require PKCE: can be enabled (the module sends a PKCE
S256)
- Redirect URI:
- Note the Client ID (
[appid]) and the Client Secret, then assign the application to the relevant users.
Configuration in Odoo
1. Install the module
Add auth_oidc to the addons path, install python-jose (pip install python-jose), then install the OpenID Connect Authentication module from Applications (or odoo -i auth_oidc).
2. Declare VaultysHub
Settings → Users & Companies → OAuth Providers → New:
| Field | Value |
|---|---|
| Provider Name | VaultysHub |
| Auth Flow | OpenID Connect (authorization code flow) |
| Client ID / Client Secret | those of the VaultysHub application |
| Authorization URL | https://your-vaultyshub.link.vaultys.org/api/oidc/[appid]/auth |
| Token URL | https://your-vaultyshub.link.vaultys.org/api/oidc/[appid]/token |
| JWKS URL | https://your-vaultyshub.link.vaultys.org/api/oidc/[appid]/jwks |
| UserInfo URL | https://your-vaultyshub.link.vaultys.org/api/oidc/[appid]/userinfo |
| Scope | openid email profile |
| Token map | sub:user_id |
| Button label | Log in with VaultysHub |
| Enabled | checked |
The module reads the user from the identity token: VaultysHub places email, email_verified, and name there.
3. Public address and reverse proxy
The redirect URI is constructed from the request address:
- run Odoo with
--proxy-modebehind a reverse proxy (headersX-Forwarded-Host/X-Forwarded-Proto); - set
web.base.urlto the public address, andweb.base.url.freezetoTrue(Settings → Technical → System Parameters).
4. Account creation (optional)
By default, only an Odoo user already linked to the provider can log in. To create the account on the first pass:
- Settings → Permissions → Customer Signup: Free Access (parameter
auth_signup.invitation_scope=b2c). - Created accounts copy the model user from the parameter
base.template_portal_user_id, which is a default portal user. To create internal users, create an inactive user with the desired rights (e.g., Employee) and specify their ID in this parameter.
VaultysHub does not pass groups: rights are managed in Odoo.
Test
Open https://odoo.example.com/web/login → Log in with VaultysHub, validate with your VaultysID: you return logged in to Odoo.
Troubleshooting
- “Invalid redirect URI”: Odoo is not in
--proxy-mode, orweb.base.urldoes not match the public address. The sent URI must be exactlyhttps://odoo.example.com/auth_oauth/signin. - “Access denied” / “Sign up is not allowed”: the user does not exist in Odoo and free signup is disabled (step 4).
- Certificate error to VaultysHub:
auth_oidcusesrequests, which has its own certificate store (REQUESTS_CA_BUNDLEfor an internal authority).