Plugins View all plugins
Resources
Live demo ↗ Request a plugin Sign in feinwerk.io ↗ Get the connector
New

The Feinwerk Connector is now in the Matomo Marketplace. Install it right inside Matomo, no download, no FTP. Read the news · Here is how →

On this page
Plugin documentation

Auth SAML

Auth SAML connects Matomo to your identity provider: SAML 2.0 single sign-on, SCIM 2.0 on- and offboarding and site permissions driven by your IdP groups. For Okta, Microsoft Entra ID, Keycloak and any SAML provider.

Plugin page · from €1,299/year net

Overview

Auth SAML turns your identity provider into the single source of truth for Matomo: sign-in via SAML 2.0 single sign-on, user lifecycle via SCIM 2.0, and site permissions driven by your IdP groups. It works with any SAML 2.0 provider and is tested with Okta, Microsoft Entra ID and Keycloak.

Sign-in and permissions from one source

On the first SSO login, Auth SAML creates the Matomo account automatically (just-in-time provisioning). On every login it synchronizes site permissions from the group claims: in the admin area you map IdP groups to Matomo sites and a role (view, write or admin). From then on, access is managed in your IdP alone. Alternatively or additionally, Auth SAML reads permissions from a direct attribute (e.g. matomo_access = "view:1,4;write:2").

Three sync modes control how strictly the IdP leads: additive (only grants, never revokes), managed (revokes only what the plugin granted itself; manually assigned permissions stay untouched) or authoritative (the IdP fully defines permissions).

Offboarding that takes effect immediately

With SCIM 2.0 enabled, your IdP actively pushes users and groups to Matomo: new team members exist before their first sign-in. When the IdP reports that someone has left, Auth SAML deactivates the account right away: login is blocked, running sessions end and the permissions the plugin granted are revoked, with no one having to remember anything. Group changes in the IdP affect site permissions immediately, without any login involved.

Secure by default, with no lockout risk

Signed assertions, RSA-SHA256, strict mode and replay protection are the defaults. At the same time, Auth SAML is built so an IdP outage does not lock you out: super users reach the password form through a break-glass login, even when Force SSO is on. Login restrictions only apply once SAML is actually configured. Only if you switch off password login for everyone is the break-glass login blocked as well. By default, Auth SAML does not adopt super user accounts automatically via SSO or SCIM. If you wish, Matomo requires multi-factor sign-in at the identity provider, and SSO users confirm sensitive actions such as creating an API token by signing in there again. An audit log records logins and account, permission and configuration changes, and a security check points out weak settings.

Setup via metadata import

Copy the SP metadata URL into your IdP, paste the IdP metadata URL into the plugin: import and daily refresh are included, and certificate rollover at the IdP (e.g. Entra ID) is picked up automatically. If your server cannot reach the URL, upload the metadata file on the admin page. Before a certificate expires, your super users receive an email. Create your group mappings, done. The SSO test on the admin page shows before you switch over which groups and attributes arrive and which permissions follow from them, and the most recent SSO errors are listed there together with the groups and attributes actually received. No more guessing why a login fails. Console commands support automated rollouts, and step-by-step guides for Okta, Entra ID and Keycloak are in the documentation.

One license, the full lifecycle

Auth SAML is deliberately built as a complete solution: one license covers the entire user lifecycle, from SAML sign-in and permission management through IdP groups to SCIM provisioning with immediate offboarding. It replaces manual user administration and separate provisioning tools.

Use cases

  • One login for everything: Your users sign in with their company account, SP- or IdP-initiated, optionally with single logout and Force SSO. Accounts are created automatically on first login.
  • Permissions from IdP groups: Group → sites → role: the mapping in the admin area turns your IdP into your access management. Permissions sync on every login and every SCIM change, and manually assigned permissions stay untouched if you want.
  • Real-time offboarding: As soon as your IdP reports a leaver via SCIM 2.0, Auth SAML deactivates the account: sessions end and the permissions the plugin granted are revoked. No login involved, no manual cleanup.
  • No lockout risk: Strict mode, signed assertions and replay protection are the defaults. Yet by default, super users keep a break-glass password login, so an IdP outage does not lock you out of Matomo.
  • Security you can prove: An audit log records SSO logins as well as account, permission and configuration changes, with CSV export. If you wish, Matomo requires multi-factor sign-in at the identity provider, SSO users confirm sensitive actions there instead of with a Matomo password, and an email arrives before a certificate expires.
  • Test instead of guessing: The SSO test on the admin page shows in advance what your identity provider sends and which account with which permissions a login would give, without signing anyone in. If a login fails later, the admin page shows why, including the groups and attributes received.

Step-by-step setup

Installation is covered in Installing plugins. You need super user access in Matomo, admin access to your identity provider (IdP) and a server clock synced via NTP (SAML tolerates only about three minutes of drift).

  1. Collect the data for your IdP. Open Administration → System → SAML SSO. It shows the SP metadata URL, the ACS URL (reply URL) and the SSO login URL. By default, the SP entity ID is your Matomo URL.
  2. Create the application in your IdP. Create a SAML 2.0 application with the ACS URL and SP entity ID, and let the IdP send email, display name and groups as attributes.
  3. Add your IdP in Matomo. Under Administration → System → General settings → Feinwerk Auth SAML (FeinwerkAuthSaml) (or via Open settings on the admin page), enter the IdP metadata URL. The URL must start with https://. Entity ID, SSO URL and certificates are imported and refreshed daily. If your Matomo server cannot fetch the URL, paste the metadata or upload the file on the admin page under Import IdP metadata. Alternatively, fill in IdP entity ID, IdP single sign-on URL and IdP X.509 certificate (PEM) by hand.
  4. Map the attributes. In Attribute mapping, the defaults email, displayName and groups fit Okta and Keycloak. Optionally, the Direct access claim attribute (default matomo_access) reads permissions such as view:1,4;write:2 or view:* straight from the IdP.
  5. Map your groups. On the admin page under Group mappings, use Add mapping to define which IdP group gets which sites (or ★ All sites) with which role (view, write or admin), then click Save mappings.
  6. Decide on login behaviour. The login page now shows a Sign in with SSO button. After a successful test, optionally enable Force SSO and set who may still use a password under Password login allowed for (default: Super users only).
  7. Optional: SCIM. Turn on Enable SCIM 2.0 endpoint and create a bearer token on the admin page with Generate new token (shown only once). In your IdP, enter the SCIM base URL https://<matomo>/index.php/scim/v2 and the token. Under Offboarding behaviour, choose Deactivate user (recommended) or Delete user permanently.
  8. Optional: single logout. Click Generate SP certificate, download it with Download certificate (PEM), upload it to your IdP and turn on Enable single logout (SLO).

First test: on the admin page, click Test the SSO login and sign in at your IdP, ideally with a test account. You see the attributes, groups and sign-in method received as well as the account and permissions a login would give. Your Matomo session stays as it is and no account is created. Then sign in with Sign in with SSO in a private browser window. If sign-in fails, look up the error reference from the error page under Last SSO errors on the admin page. For missing permissions, it also lists the groups and attributes received.

Emergency access: https://<matomo>/index.php?module=Login&action=login&direct=1 takes super users to the password form even when Force SSO is on (break-glass login).

Practical examples

Microsoft Entra ID. Under Enterprise Applications → New application → Create your own, create a non-gallery app. In Single sign-on → SAML, set Identifier = SP entity ID and Reply URL = ACS URL. You find the App Federation Metadata Url in the same place under SAML Certificates. It ends in ?appid=…, and only with this suffix do the metadata contain the signing certificate of exactly this app. Enter it in the plugin as IdP metadata URL, so certificate rollovers in Entra arrive automatically. If your Matomo server cannot reach login.microsoftonline.com, download the Federation Metadata XML there and paste it on the admin page under Import IdP metadata; import it again after a certificate rollover. Add the groups claim under Token configuration → Add groups claim. In the plugin, set Groups attribute to http://schemas.microsoft.com/ws/2008/06/identity/claims/groups and E-mail attribute to http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress. Entra sends group object IDs, so use those IDs as group names in your mappings. SCIM is set up under Provisioning → Automatic.

  • Signed requests (optional): On the admin page, click Generate SP certificate and Download certificate (PEM), and change the file extension to .cer. In Entra, under Single sign-on → SAML Certificates → Verification certificates (optional) → Edit, turn on Require verification certificates and upload the certificate. Auth SAML signs with RSA-SHA256; leave the SHA-1 option off. After that, sign-ins that Entra starts itself (the tile in My Apps, Test in the Entra portal) no longer work, because Entra does not know the private key. The SSO test on the admin page keeps working. Without a signature, Entra reports error AADSTS76021.
  • Single logout (optional): In Entra, under Basic SAML Configuration, enter the SLS URL https://<matomo>/index.php?module=FeinwerkAuthSaml&action=sls as Logout Url, and turn on Enable single logout (SLO) in the plugin.

Okta. Under Applications → Create App Integration → SAML 2.0, set Single Sign-On URL = ACS URL and Audience URI = SP entity ID. Attribute statements: email → user.email and displayName → user.displayName, plus a group attribute statement named groups. The app's metadata URL becomes your IdP metadata URL, SCIM lives under Provisioning → SCIM. For signed requests, upload the SP certificate under SAML Settings → Advanced → Signature Certificate.

Keycloak. Under Clients → Create client → SAML, set Client ID = SP entity ID and the ACS URL as valid redirect URI. Add client scope mappers for email, displayName and groups (full group path off). The IdP metadata URL is https://<keycloak>/realms/<realm>/protocol/saml/descriptor.

Good to know

  • Super users: super user access is only granted if Allow super user via claims is on and a Super user group / claim value is set. If the group disappears later, the plugin removes the rights it granted; super users the plugin did not appoint and the last super user are never demoted. Existing super user accounts are not adopted automatically via SSO or SCIM (Never adopt super user accounts automatically, on by default). For a super user to sign in via SSO, switch the setting off for their first sign-in. Only super users see the admin page and settings.
  • No permissions, no login: Deny login when claims grant no permissions is on by default, so people outside your mapped groups see an error instead of an empty Matomo.
  • No lockout: the password login policy and password reset block only apply once SAML is configured. With the policy Nobody (SSO only), the break-glass login is blocked too. Then use the command line: ./console feinwerkauthsaml:set-setting '{"passwordLoginPolicy":"superusers"}'
  • Confirmation through SSO: Matomo asks for the password before sensitive actions. SSO users confirm by signing in at the IdP again instead: in the confirmation dialog through Confirm with SSO (from Matomo 5.14), and automatically before creating an API token. The confirmation then lasts 15 minutes, as it does right after the SSO login. Your IdP must actually ask for a new sign-in (ForceAuthn); the SSO test shows whether it does. Alternatively, choose Do not ask or Require the Matomo password under Password confirmation in SSO sessions.
  • Two-factor and MFA: Matomo's own two-factor authentication is skipped for SSO logins (Skip Matomo's two-factor authentication for SSO logins, on by default), since the sign-in happens at the IdP. Make sure MFA is enforced there, or let Matomo require it: enter your IdP's value under Request an authentication context, for Microsoft Entra ID http://schemas.microsoft.com/claims/multipleauthn. Logins without this context are then refused. The SSO test shows which context your IdP reports.
  • Bind the login to the browser: an SSO login started through Matomo only counts in the browser in which it was started, so nobody can slip a login into another person's browser. The setting is on by default and works when Matomo is reached over HTTPS (behind a proxy, as Matomo detects it for its own session cookie). It does not cover logins that start in the identity provider's portal: if your users only sign in through Matomo, switch off Allow IdP-initiated login. Switch the binding off only if logins in the same browser still fail with the message that they were started in another browser, for example because a proxy or a browser extension removes cookies.
  • SSO accounts: SSO users change their email address and password at their IdP, not in Matomo, and API tokens created with username and password are blocked for them (Lock e-mail, password and password-based tokens of SSO accounts, on by default). Characters Matomo does not allow in usernames (such as an apostrophe) are replaced with _ for new accounts.
  • Audit log: the admin page lists SSO logins, refusals and errors, created, adopted and deleted accounts, and permission, SCIM and configuration changes, each with time and acting user. Export it as CSV through the link on the admin page. Entries are deleted after Keep the audit log (days) (default 365).
  • Certificates: 30, 14, 7 and 1 day before an IdP or SP certificate expires, and when it has expired, all super users receive an email, or the addresses under Recipients of certificate e-mails.
  • Diagnostics: ./console feinwerkauthsaml:diagnostics shows SAML and SCIM status, metadata errors and the latest SSO errors. Under Administration → Diagnostic → System Check the plugin also reports configuration problems, warns 30 days before a certificate expires and, with a security check that the admin page shows as well, points out settings that weaken the SSO login. For more detail, turn on Debug logging.
  • Reverse proxy: behind a TLS-terminating proxy or load balancer, turn on Running behind a reverse proxy (trust X-Forwarded headers).
  • SCIM and nginx: SCIM URLs use PATH_INFO. Apache and IIS need no changes, nginx must pass paths like index.php/scim/v2/... on to PHP. The admin page shows whether the endpoint is reachable.
  • Stored data: the SCIM token is kept only as a hash. For replay protection, the plugin remembers used assertion IDs and removes expired ones daily.

Technical reference

PropertyValue
Technical nameFeinwerkAuthSaml
Current version6.2.0
Matomo≥ 6.0.0, < 7.0.0-b1
PHP≥ 8.1.0
Licensepaid
Database changesnone in the current version

FAQ

Which identity providers are supported?

Any SAML 2.0 compliant IdP. Auth SAML is tested with Okta, Microsoft Entra ID and Keycloak. GitHub does not offer SAML as an IdP, so use a brokering IdP such as Keycloak there.

Do I need SCIM?

No. Account creation and permission sync work entirely through the SAML login (just-in-time). SCIM is worth it when offboarding must take effect immediately instead of at the next login.

Can I still assign permissions manually in Matomo?

Yes. In the default "managed" mode, Auth SAML only revokes permissions it granted itself, and everything assigned manually stays untouched. If you want the IdP as the single source of truth, choose the authoritative mode.

What happens if the identity provider goes down?

Super users still reach the password form through the break-glass login, even when Force SSO is on. You decide who else may sign in with a password: everyone, super users only (the default) or nobody. If you switch password login off completely, the break-glass login is blocked too. The setting can then be reset on the command line.

Do SSO users need to know their Matomo password?

No. Before sensitive actions such as creating an API token they confirm by signing in at the identity provider again, and Matomo's own two-factor prompt is skipped for SSO logins, since the sign-in happens at the identity provider. Both can be changed in the settings.

How much effort is the setup?

Manageable: register the SP metadata URL in your IdP, paste the IdP metadata URL into the plugin (automatic import with daily refresh) or upload the metadata file, create your group mappings. The SSO test on the admin page shows what arrives before you switch over. Step-by-step guides for Okta, Entra ID and Keycloak are in the documentation.

Are super user rights granted via SSO?

Only if you explicitly enable it and define a dedicated IdP group. If the group later disappears from the claim, Auth SAML removes the super user rights it granted itself. Super users the plugin did not appoint are never demoted, and neither is the last super user.

What happens to existing Matomo users?

They are adopted, not duplicated: on the first SSO login, Auth SAML matches the account by login or email address and links it to the IdP permanently. The password is kept, and manually assigned site permissions stay untouched in the default mode, because the plugin only ever revokes what it granted itself. By default, Auth SAML does not adopt super user accounts automatically, so no IdP account can take over the local emergency access, and existing super users are never demoted. SCIM provisioning adopts existing accounts the same way, so you can introduce SSO on a running Matomo installation without recreating users or losing permissions.

Why is Auth SAML priced above simple SSO plugins?

Because it covers more: beyond SAML sign-in, Auth SAML includes permission management through IdP groups and a full SCIM 2.0 server for automatic on- and offboarding. One license replaces manual user administration across the entire lifecycle.