Module SmartAuth

From Dolibarr ERP CRM Wiki
Revision as of 19:30, 30 November 2026 by Eric.seigne (talk | contribs) (SmartAuth 2.0.76)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Information


Module name SmartAuth
Editor / Editeur CAP-REL - www.cap-rel.fr
Download or buy page / Page achat ou téléchargement External module - www.dolistore.com
Status / Statut / Estado Stable
Prerequisites / Prérequis No Dolibarr module required

Dolibarr min version: See on Dolistore    Dolibarr max version: See on Dolistore

Last update date / Date mise à jour fiche / Fecha última actualización 2026-11-30
Note / Nota Authentication and authorization of the applications connected to Dolibarr: JWT tokens for mobile apps, OAuth2 / OpenID Connect server for single sign-on, client credentials for server-to-server exchanges.

Features

Your users already have a Dolibarr account. SmartAuth makes it the single identity of your mobile apps, third-party services and server-to-server exchanges, with no second directory and no second password.

At a glance

  • For whom: any organisation running a mobile app, a customer portal or an in-house service next to its Dolibarr. SmartAuth is also the common base of the SmartMaker apps by CAP-REL.
  • What the module does: it authenticates external applications, issues their tokens, tracks the connected devices and logs the accesses.
  • What it does not do: it does not replace the login of the Dolibarr web interface, which stays the Dolibarr one.

Feature list

  • JWT API - an access token and refresh token pair per device for mobile apps; each device forms an isolated token family, revocable on its own.
  • OAuth2 / OpenID Connect - Dolibarr becomes the identity provider of WordPress, Nextcloud or any compatible application: authorization, token, userinfo, discovery, revocation; confidential clients, or public clients with PKCE.
  • Client credentials - machine-to-machine authentication with no user interaction, under the identity of a service user.
  • QR code pairing - a Dolibarr workstation already signed in shows a short-lived QR code, the phone scans it and receives its tokens once the workstation confirms, with no password typed.
  • Dashboard - active tokens, connected users, rate limit blocks and refresh success rate, with alerts on token replay, brute force and repeated failed attempts.
  • Tokens, devices and logs - browsable lists, devices that can be renamed, immediate revocation, history of logins and API calls.
  • SmartAuth tab on the user card - tokens and history of each user.
  • Security - rate limiting per IP address and per user, token replay detection, email alert on a login from an unknown IP address or device, optional GeoIP location.
  • External users kept to their company - a user linked to a third party only sees, in the apps, the data of their own company, as in Dolibarr.
  • PWA fields - settings of the photo lists (smartlistphoto_ extra fields) shown by the apps.
  • Scheduled job - cleanup of expired tokens and old logs.

Screenshots

Links

Requirements

Item Version or condition
Dolibarr 18.0 or later
PHP 7.4 or later
Rights an administrator account to install, enable and set up the module

Installation

  • Download archive file of module (.zip file) from web site www.dolistore.com or from any other source.
  • Install module into the /custom folder of Dolibarr:
    • Go to Home - Setup - Modules - Deploy/install external app/module
    • Upload the file. Note: If it fails because upload from this page has been locked by your web hosting provider, you can manually unzip the file into the /custom directory from command line: Go into the /custom directory and uncompress file with command unzip modulefile.zip then check that the directory with the nameof the module is inside the /custom directory. If into a subdirectory, just move it into /custom.
  • Module should be ready to be activated and used.

Upgrade

  1. Install the new version through Home > Setup > Modules/Applications > Deploy/install external app/module.
  2. Disable then enable the module again: enabling it applies the database updates.

Uninstall

Disable the module from Home > Setup > Modules/Applications.

Setup

To use this module, you must first enable it using an administrator account, via the menu option "Home - Setup - Modules".

Choose the tab where the module is listed. Then click on "Activate".

The module is now activated.

If a cog icon appears Cog circle.svg on module thumb or at end of the line of the module, click on it to access the setup page specific to the module.

The setup is in Home > Setup > Modules > SmartAuth:

Tab Content
Settings token lifetime (10, 20, 30 or 90 days, 30 by default), default user, logs and how long they are kept, trusted proxies, debug mode
OAuth Server enabling and settings of the OAuth2 / OpenID Connect server
OAuth Clients the applications allowed to connect: confidential, or public with PKCE
PWA fields maximum number of photos of the photo lists (between 1 and 100, 20 by default)
GeoIP Setup download and activation of the location database

The cleanup scheduled job is disabled by default: enable it in Home > Setup > Scheduled jobs.

If you enable the OAuth2 server, expose the public SSO portal of the module on a dedicated subdomain: the OAuth2/OIDC documentation describes the web server setup.

Permissions

The module defines one read permission, Read objects of SmartAuth, which gives access to its pages. An administrator grants it from Home > Users & Groups, Permissions tab. The setup pages remain restricted to administrators.

Usage

Once enabled, the Tools > SmartAuth menu appears in the left menu.

Dashboard

Four indicators: active tokens, connected users, rate limit blocks over 24 hours and refresh success rate. Alerts report the token families revoked after a replay, the IP addresses with repeated attempts and the accounts targeted by brute force.

Tokens and devices

Tools > SmartAuth > Tokens lists the active tokens; revoking one signs the device out immediately. Tools > SmartAuth > Devices lets you rename a device, see its activity or revoke it.

Logs

Tools > SmartAuth > Logs shows the logins and API calls, once log collection is enabled in the settings.

User tab

The SmartAuth tab of each user card shows their tokens and login history.

Details are in the user guide.

FAQ

Does SmartAuth replace the Dolibarr login?
No. The Dolibarr web interface keeps its own login; SmartAuth only authenticates external applications.

Do the SmartMaker mobile apps need the OAuth server?
No. They use JWT tokens, independent from the OAuth server, which only serves single sign-on and server-to-server exchanges.

Why was a token revoked automatically?
A refresh token already used was presented a second time: the whole token family of the device is revoked to protect it against theft.

The logs stay empty.
Log collection is disabled by default: enable it in the Settings tab.

All questions: documentation FAQ.

Development

Developments and improvements can be proposed to the project manager by email (see the headers of the source files) or through the support form.