Skip to content

SmartAuth 2.0.76: devices stay connected, and you know why a session ends

Project : SmartAuth Editor : CAP-REL Version : 2.0.76 Date : Dolibarr 18 to 24

Major fix stable announced 4 days ago declared compatibility
This announcement is a translation. Read the original version (Français)

This version includes the changes released since 2.0.70.

Stay connected on a daily-used device

A SmartMaker application renews its access token every hour. SmartAuth limited this renewal to one hundred times per device: an application left open all day would ask for the password again after one to two weeks. This limit is now a duration: a device stays connected for 90 days after its connection, regardless of usage, then asks for the password once. A device left unused for 30 days must still reconnect.

The duration is set by the constant SMARTAUTH_TOKEN_FAMILY_MAX_DAYS, in days. A value of 0 removes the limit, which is discouraged: a stolen session would remain valid as long as it is used.

A device that resends its renewal request, on an unstable mobile network for example, is no longer disconnected for that reason.

Know why a device was disconnected

SmartAuth closes a session when its renewal token is presented a second time—a sign of a copied token—or when it reaches its maximum duration. The denied request then appears in the logs of the SmartAuth tab of the user card, with the reason in the Message column. For this to work, logging must be enabled (Collect logs in the module setup).

The list of tokens in the same tab can be filtered for expired tokens, which are no longer counted among active tokens.

A more informative API log

  • A denied request includes its reason and the user who sent it.
  • Each connection and token renewal is linked to its token and user.
  • Photos, documents, and other responses are logged with their actual type and size.
  • The Item column, always empty, is hidden.

Open the application from the QR code

The QR code on the SmartAuth tab opens a module’s application, and its address is displayed with it.

Update

Replace the module folder, then deactivate and reactivate it: the database gains a table and two columns in the API log. As long as the module is not reactivated, the log continues to be filled, without the user or the reason for denials.