Table of Contents

Single-Sign-On into Odoo using Admidio as an OpenID Provider

Starting with version 5.0, Admidio can be used by other applications to authenticate users against Admidio's user base. These instructions will guide you through the process of connecting Odoo to Admidio to use Admidio's login. For general instructions, and other apps, please visit the general Single-Sign-On overview page.

Odoo provides several apps that offer OpenID Connect login to Odoo, we are using and describing the Authentication OpenID Connect (auth_oidc) here. It supports auto-provisioning of users (i.e. new users are automatically created in Odoo, when they successfully log in through Admidio), but groups are not supported.

Prerequisites

Throughout the document we will assume you have both Admidio and Odoo already set up properly at https://admidio.local/ and https://odoo.local/. Please modify these URLs to your actual installation.

As a first step, one needs to configure Admidio to act as an OpenID Provider (OP). This has to be done once and is not specific to Odoo. Please follow this guide: #a_basic_setup_for_admidio_as_an_oidc_id_provider

Basically, one (1) needs to create a cryptographic key to sign message and choose a unique EntityID. The page https://admidio.local/adm_program/modules/preferences.php?panel=sso also provides the link to the metadata xml, and the individual settings in case a client does not support auto-configuration via metadata.

Quick Overview

Setting up a client (OpenID “Relying Party” - short RP) to use Admidio's user accounts for logging in consists of two steps: (1) The client (RP, Odoo in our case) needs to be set up with the data about the OpenID Provider (OP). One has to manually paste the Admidio endpoint URLs of the OpenID provider into the client's configuration. Admidio provides copy buttons in the preferences screen, so this is rather straightforward. (2) Admidio needs to be told about the client. In particular, the entity ID and the redirect URL must be given, and a custom-generated (random) secret must be copied to the client configuration.

The concrete steps are:

Odoo Login via OpenID using the OpenID Connect user backend (user_oidc)

Configuring the Service Provider (Odoo)

First, install the Authentication OpenID Connect (auth_oidc) app in Odoo:

It is now a good idea to keep two browser windows open with Admidio and Odoo's configuration so one can easily select and copy the settings. Admidio even provides little “copy” buttons/icons to copy the various settings to the clipboard for easy pasting into the Odoo configuration.

Setting up the Client (SP) in Admidio

The next step is to set up Admidio to receive login requests from Odoo. This is done by adding an OpenID client in Admidio.

Return to Admidio's SSO preferences page, go to the “Single-Sign-On Client Administration” (the button right below the endpoint URLs and above the “Save” button), and create a new client.

After saving the changes (both in Odoo and Admidio), the apps should should now be set up for single-sign-on in Odoo.

Automatic User Creation (Provisionin)

Odoo can automatically create a new user when a new account logs in using OpenID Connect through Admidio. This functionality is provided by the auth_signup plugin, which must be activated and configured. In developer mode, go to “Settings” → “Technical” → “Parameters” ⇒ “System Parameters” and create a new key auth_signup.allow_uninvited with value 'True'.

This settings causes the “Don't have an account?” signup link to appear in the login form, and it will allow signup by anyone. However, in my tests, enabling this setting also enabled automatic account provisioning with OpenID Connect.

Setup completed, test Single-Sign-On

Admidio and Odoo should now be set up to use Admidio for logging in to Odoo. If you log out of Odoo and try to log in again, you will be shown the Admidio login screen and then redirected back to Odoo. The login buttons for each of the three possible OpenID plugins look very similar and work similar.

After successful login to Admidio, the user will be redirected back to Odoo and logged in.

If you look at the user profile in the admin backend, the Admidio account will be connected to the (existing or newly created) Odoo account and the user Id and OAuth Access Token stored in the user profile for future login.