This module allows users to login through an OpenID Connect provider using the authorization code flow or implicit flow.
Note the implicit flow is not recommended because it exposes access tokens to the browser and in http logs.
Table of contents
This module depends on the
python-jose library, not to
be confused with jose
which is also available on PyPI.
Example configuration with OpenID Connect authorization code flow.
- configure a new web application in Azure with OpenID and code flow (see the provider documentation))
- in this application the redirect url must be be "<url of your server>/auth_oauth/signin" and of course this URL should be reachable from Azure
- create a new authentication provider in Odoo with the following parameters (see the portal documentation for more information):
Single tenant provider limits the access to user of your tenant, while Multitenants allow access for all AzureAD users, so user of foreign companies can use their AzureAD login without an guest account.
- Provider Name: Azure AD Single Tenant
- Client ID: Application (client) id
- Client Secret: Client secret
- Allowed: yes
- replace {tenant_id} in urls with your Azure tenant id
or
- Provider Name: Azure AD Multitenant
- Client ID: Application (client) id
- Client Secret: Client secret
- Allowed: yes
- Auth Link Params: Add {'prompt':'select_account'} to the auth link to get the account selection screen
Example configuration with OpenID Connect authorization code flow.
In Keycloak:
- configure a new Client
- make sure Authorization Code Flow is Enabled.
- configure the client Access Type as "confidential" and take note of the client secret in the Credentials tab
- configure the redirect url to be "<url of your server>/auth_oauth/signin"
In Odoo, create a new Oauth Provider with the following parameters:
- Provider name: Keycloak (or any name you like that identify your keycloak provider)
- Auth Flow: OpenID Connect (authorization code flow)
- Token Map : many options are possible like
preferred_username:user_id
oremail:user_id
. This can be combined - Client ID: the same Client ID you entered when configuring the client in Keycloak
- Client Secret: found in keycloak on the client Credentials tab
- Allowed: yes
- Body: the link text to appear on the login page, such as Login with Keycloak
- Scope: openid email
- Authentication URL: The "authorization_endpoint" URL found in the OpenID Endpoint Configuration of your Keycloak realm
- Token URL: The "token_endpoint" URL found in the OpenID Endpoint Configuration of your Keycloak realm
- JWKS URL: The "jwks_uri" URL found in the OpenID Endpoint Configuration of your Keycloak realm
On the login page, click on the authentication provider you configured.
- When going to the login screen, check for a existing token and do a direct login without the clicking on the SSO link
- When doing a logout an extra option to also logout at the SSO provider.
- Forward port OpenID Connect fixes from 15.0 to 16.0
- Readme link updates
- Add AzureAD code flow provider
- Odoo 16 migration
- Odoo 15 migration
- Odoo 14 migration
- Odoo 13 migration, add authorization code flow.
- Initial implementation
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed feedback.
Do not contact contributors directly about support or help with technical issues.
- ICTSTUDIO
- André Schenkels
- ACSONE SA/NV
- Alexandre Fayolle <[email protected]>
- Stéphane Bidoul <[email protected]>
- David Jaen <[email protected]>
- Andreas Perhab <[email protected]>
This module is maintained by the OCA.
OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.
Current maintainer:
This module is part of the OCA/server-auth project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.