Skip to main content

Dealership Clients

Each dealership branch (e.g. Bacolod, Makati, Cebu) gets its own Keycloak client. This allows each Odoo instance to authenticate independently while sharing the same SSO session.

:::info Portal client vs dealership clients The Portal client (portal-odoo) is covered in the Portal Client guide. This page covers the per-dealership clients that each Odoo dealership instance uses. :::


Step 1: Create the client

  1. Navigate to Clients in the sidebar.
  2. Click Create client.
  3. Fill in:
FieldValueExample
Client typeOpenID ConnectAlways OIDC for Odoo
Client ID<dealership-code>-dealershipbacolod-dealership
NameUAAGI <City> DealershipUAAGI Bacolod Dealership
DescriptionBrand listMulti-brand dealership: FOTON, Chery, Jetour, BAIC, Lynk & Co, RADAR
  1. Click Next, then Save.

:::caution Client ID naming convention The Client ID must match the keycloak_client_id field on the corresponding uaagi.dealership record in Odoo. This is how Odoo maps the allowed_dealerships token claim to dealership records. :::


Step 2: Settings tab — General & Access settings

Open the newly created client and navigate to the Settings tab.

Client Settings — General &amp; Access settings

General settings

FieldValue
Always display in UIOff

Access settings

FieldValueNotes
Root URLhttps://<subdomain>.uaagi-uno.comThe dealership's Odoo instance URL
Home URLhttps://<subdomain>.uaagi-uno.comSame as Root URL
Valid redirect URIsSee table belowWhere Keycloak is allowed to redirect after login

Valid redirect URIs (add all three):

URIPurpose
https://<subdomain>.uaagi-uno.com/auth_oauth/signinOdoo's OAuth callback endpoint
https://<subdomain>.uaagi-uno.com/*Wildcard fallback
https://<subdomain>.uaagi-uno.com/webDirect web access

Step 3: Settings tab — Post-logout, Web origins & Capability config

Scroll down on the Settings tab.

Client Settings — Post-logout, Web origins &amp; Capability config

Post-logout redirect URIs

URIPurpose
https://portal.uaagi-uno.com/*Allows logout to redirect back to the portal

:::warning Portal URI is required Without https://portal.uaagi-uno.com/* in the post-logout redirect URIs, users will see an "Invalid redirect" error when logging out from a dealership and being sent back to the portal. :::

Web origins & Admin URL

FieldValue
Web originshttps://<subdomain>.uaagi-uno.com
Admin URLhttps://<subdomain>.uaagi-uno.com

Capability config

SettingValueNotes
Client authenticationOnThis is a confidential client (has a secret)
AuthorizationOffNot using Keycloak's fine-grained authorization
Standard flowCheckedAuthorization Code flow — required for Odoo
Implicit flowUncheckedNot used
Direct access grantsUncheckedNo password-grant logins
Service accounts rolesUncheckedNot a machine-to-machine client
OAuth 2.0 Device Authorization GrantUnchecked
OIDC CIBA GrantUnchecked

Step 4: Login & Logout settings

Still on the Settings tab, scroll to the bottom.

Client Settings — Login &amp; Logout settings

Login settings

SettingValue
Login theme(default — Choose...)
Consent requiredOff
Display client on screenOff

Logout settings

SettingValueNotes
Front channel logoutOffOdoo handles logout via redirect, not front-channel
Backchannel logout URL(empty)Not configured — Odoo uses redirect-based logout
Backchannel logout session requiredOnDefault, ensures session context in backchannel calls
Backchannel logout revoke offline sessionsOffNo offline tokens in use

Click Save.


Step 5: Credentials tab

Navigate to the Credentials tab.

Client Credentials tab

FieldValue
Client AuthenticatorClient Id and Secret
Client SecretAuto-generated — click the copy icon to copy

:::danger Keep the secret secure Copy the Client Secret and store it securely. You will need it when configuring the OAuth provider in Odoo (see Odoo Configuration). Never commit secrets to version control. :::

To rotate a compromised secret, click Regenerate and update the corresponding Odoo OAuth provider record immediately.


Step 6: Advanced tab — PKCE

Navigate to the Advanced tab, then scroll to the Advanced settings section.

Client Advanced settings — PKCE

SettingValueNotes
Access Token LifespanInherits from realm settingsUses the realm's 30-minute default
Client Session IdleInherits from realm settings
Client Session MaxInherits from realm settings
Client Offline Session IdleInherits from realm settings
Proof Key for Code Exchange Code Challenge MethodS256Required — enables PKCE

:::warning PKCE must be S256 The Odoo uaagi_dealership_portal module generates PKCE code_challenge / code_verifier pairs using SHA-256. If this is not set to S256, the authorization code exchange will fail with an invalid_grant error. :::

All other Advanced settings should remain at their defaults (Off).

Click Save.


Repeat for each dealership

Create a client for every dealership branch in the system. The naming convention is:

<city-or-code>-dealership

Examples: makati-dealership, cebu-dealership, davao-dealership, bacolod-dealership

Each client follows the exact same configuration — only the Client ID, Name, Description, and URLs change.

:::tip Bulk provisioning For large deployments, the uaagi_keycloak_setup.py script in the uaagi_dealership_portal module can automate client creation via the Keycloak Admin REST API. :::


Quick checklist

Use this checklist when adding a new dealership client:

  • Client type: OpenID Connect
  • Client ID matches Odoo's keycloak_client_id
  • Root URL / Home URL set to dealership's Odoo URL
  • Valid redirect URIs include /auth_oauth/signin and /*
  • Post-logout redirect URIs include https://portal.uaagi-uno.com/*
  • Client authentication: On (confidential)
  • Standard flow: checked (only)
  • PKCE: S256
  • Client secret copied to Odoo OAuth provider record

What's next

  • Protocol Mappers — configure the custom attribute mappings that send dealership assignments in the token
  • User Management — create users and assign them to dealerships