Skip to main content

Odoo Configuration

After Keycloak is set up, each Odoo instance needs an OAuth Provider record and a system parameter to complete the SSO integration.


Step 1: Open the OAuth Providers list

Navigate to Settings > Users & Companies > OAuth Providers.

Odoo OAuth Providers list

Odoo ships with three default providers (Odoo.com Accounts, Facebook Graph, Google OAuth2). You will add a new UAAGI SSO provider — the only one that should be Allowed (enabled).


Step 2: Create the OAuth Provider

Click New and fill in every field as shown below.

Odoo OAuth Provider form — UAAGI SSO

Portal instance (portal.uaagi-uno.com)

FieldValueNotes
Provider nameUAAGI SSODisplay name in the admin list
Client IDportal-odooMust match the Keycloak client ID exactly
Client Secret(from Keycloak Credentials tab)Paste the secret from the portal-odoo client
AllowedCheckedEnables this provider on the login page
Login button labelLogin with UAAGI SSOText shown on the login button
CSS classfa fa-fw fa-sign-in text-primaryFont Awesome icon for the button
Authorization URLhttps://sso.uaagi-uno.com/realms/uaagi-dealerships/protocol/openid-connect/authKeycloak's authorization endpoint
Scopeopenid profile emailStandard OIDC scopes
UserInfo URLhttps://sso.uaagi-uno.com/realms/uaagi-dealerships/protocol/openid-connect/userinfoKeycloak's userinfo endpoint
Data Endpoint(empty)Not used — userinfo is sufficient
Token URLhttps://sso.uaagi-uno.com/realms/uaagi-dealerships/protocol/openid-connect/tokenFor Authorization Code exchange
Logout URLhttps://sso.uaagi-uno.com/realms/uaagi-dealerships/protocol/openid-connect/logoutFor SSO logout
Token Mapsub:user_idMaps Keycloak's sub claim to Odoo's OAuth user ID
OAuth FlowAuthorization CodeRequired for PKCE (S256)
JWKS URI(empty)Optional — for local token validation

Click Save.

Dealership instance (e.g. makati.uaagi-uno.com)

Create the same record on each dealership instance, changing only:

FieldPortal valueDealership value
Client IDportal-odoomakati-dealership (matches Keycloak client)
Client SecretPortal client secretDealership client secret

All endpoint URLs remain the same — they always point to the shared uaagi-dealerships realm.

:::caution One provider per instance Each Odoo instance should have exactly one enabled UAAGI SSO provider. Disable the default providers (Odoo.com, Facebook, Google) unless you need them. :::


After a user logs in via SSO, their Odoo user record will show the OAuth link. Navigate to Settings > Users & Companies > Users, open a user, and click the Oauth tab.

Odoo user form — OAuth tab

FieldDescription
OAuth ProviderThe provider this user authenticated through (UAAGI SSO)
OAuth User IDThe Keycloak sub claim (UUID) — uniquely identifies this user in Keycloak
OAuth Access TokenThe current access token (long JWT string) — refreshed on each login

These fields are set automatically during OAuth login. You should never need to edit them manually.

:::info Status badge The Confirmed badge (top right) indicates the user has successfully authenticated at least once. Never Connected means the user record exists but the user has not yet logged in via SSO. :::


Step 4: Verify dealership access mapping

Click the UAAGI Dealership Access tab on the same user form.

Odoo user form — UAAGI Dealership Access tab

This tab shows the data that Odoo extracted from the Keycloak token claims:

Dealership permissions

FieldDescription
Allowed DealershipsMany2many tags — every dealership this user can access. Populated from the allowed_dealerships token claim.
Primary DealershipThe user's default dealership. Populated from the primary_dealership token claim.
Dealership CountComputed count of allowed dealerships.

UAAGI employee info

FieldDescription
UAAGI Employee IDFrom the employee_id token claim
RegionFrom the region token claim
DepartmentFrom the department token claim

OAuth sync info

FieldDescription
Keycloak User IDThe sub claim — same as OAuth User ID
Last OAuth SyncTimestamp of the last login when attributes were refreshed

:::tip Attributes refresh on every login These fields are updated every time the user logs in via SSO. If you change a user's allowed_dealerships in Keycloak, the change takes effect on their next login — no manual Odoo update needed. :::


Step 5: System parameters

Navigate to Settings > Technical > Parameters > System Parameters in Odoo.

Portal instance

KeyValuePurpose
uaagi.is_portal_instanceTrueEnables auto-redirect to Keycloak on login and shows the dealership selector after authentication

Dealership instance

KeyValuePurpose
uaagi.portal_urlhttps://portal.uaagi-uno.comUsed for "Back to Portal" links and post-logout redirects

What's next