SuiteCRM single sign-on with Keycloak over SAML

This page explains how to connect a self-hosted SuiteCRM 8.7 or later instance to Keycloak as a SAML identity provider, what to configure on each side, and which logout limits to tell users about before go-live.

On this page

How SuiteCRM SSO with Keycloak over SAML works

Your team runs SuiteCRM 8.7 or later and wants staff to sign in with the central identity service they already use. SuiteCRM 8.7 and later support SAML login through the nbgrp onelogin-saml-bundle, enabled by setting AUTH_TYPE=saml, and Keycloak acts as the SAML identity provider in this design. SuiteCRM is the service provider, so it trusts assertions that Keycloak issues for each user and does not check passwords itself. Keycloak holds the realm, client and user records, while SuiteCRM holds the matching local user that the assertion identifies.

Most of the SAML configuration lives in environment files, so the settings that describe the identity provider, the service provider endpoints and the attributes used to match users are version-controlled and reviewed like other deployment config. The service provider certificate and private key should not sit in those files. SuiteCRM documents storing them as Symfony secrets, set with php bin/console secrets:set and referenced from the environment. Plan who holds the secret vault keys and how certificate rotation is scheduled, because a rotated certificate must also be updated in the Keycloak client. Confirm the exact variable names against the 8.7.0+ SAML configuration reference before you build.

The sign-on flow is one-way in logout terms. Because the 8.7.0+ SAML implementation does not support IdP-initiated logout or POST binding to the logout service, ending a session in Keycloak does not end the SuiteCRM session. Tell users that signing out of SuiteCRM is what closes the CRM session, and set session lifetimes with that gap in mind, especially on shared workstations. Before rollout, test a sign-in, a sign-out and a user who is disabled in Keycloak, and confirm how your team's offboarding process reaches SuiteCRM.

What you need before connecting SuiteCRM to Keycloak

Most SAML problems come from the environment, not the sign-on settings. Confirm these six items before you change anything in SuiteCRM, so the Keycloak client, the certificates and the SuiteCRM environment file all match the same hostnames and versions.

SuiteCRM 8.7.0 or later

SAML login in SuiteCRM 8 depends on the 8.7.0 implementation, so an older 8.x instance needs an upgrade first. Confirm the exact version in use, then check PHP 8.2, 8.3 or 8.4, Apache 2.4 and a MariaDB or MySQL version against the SuiteCRM 8.10 compatibility matrix. A stack outside that matrix is a support question before it is a sign-on question.

Compatibility matrix

A Keycloak release you can operate

The current Keycloak release is 26.8.1, and the project ships minor releases several times a year. Choose a version your team can patch on a schedule, and run it on a production database from the supported list, such as PostgreSQL 14 to 18. The dev-file database is for development only and should not carry real logins.

Keycloak database guide

Realm, client and an admin to change them

Decide which Keycloak realm holds SuiteCRM users and which SAML client represents the SuiteCRM service provider. Name the client after the environment, such as production and staging, so each has its own entity ID and certificate. Confirm that a named administrator can change the realm, client mappers and certificates during the cutover window.

HTTPS hostnames and network paths

The browser must reach SuiteCRM and Keycloak over HTTPS on stable hostnames, because the SAML entity IDs, assertion consumer URLs and redirects all embed them. Confirm that SuiteCRM can reach the Keycloak metadata and token endpoints over the network and that Keycloak's frontend URL matches the name users type. A hostname change later means updating the client, the environment file and the certificates together.

Certificates and keys ready before switching

Generate the service provider certificate and private key, and store them as Symfony secrets with php bin/console secrets:set, then reference them from the environment settings. Do this before setting AUTH_TYPE=saml, so the first login attempt does not fail on missing keys. Confirm the exact variable names and certificate format with the SuiteCRM 8.7.0+ SAML configuration reference.

Symfony secrets guide

A staging SuiteCRM instance

Build the full SAML path on a staging SuiteCRM with its own Keycloak client, hostname and test users before touching production. Staging should match production's PHP, web server and database versions, so that certificate and session behavior can be checked against the same stack. Keep a copy of the working environment file so a failed cutover can be reversed quickly.

How a SuiteCRM login flows through Keycloak

The login starts in the user's browser, which requests SuiteCRM. SuiteCRM, acting as the service provider, sends a SAML authentication request to Keycloak, the identity provider, inside the trust boundary of the identity network. After the user signs in at Keycloak, a SAML response returns through the browser to SuiteCRM, which matches the asserted username to a local user and creates its own session. Check that the username matches exactly and that a Keycloak logout does not end the SuiteCRM session.

SAML login from browser to Keycloak and back, with the local SuiteCRM session created after username matching.

Configuring SuiteCRM and Keycloak in the right order

This sequence takes SuiteCRM 8.7 or later from no federated sign-on to a tested Keycloak SAML login, with the service provider keys stored outside the environment files and the username mapping confirmed before any real user is switched over.

  1. Create the Keycloak realm and SAML client

    The Keycloak administrator creates or selects a realm for the SuiteCRM users and adds a SAML client whose client ID and redirect (assertion consumer) URLs match the SuiteCRM hostname on staging, using the SAML configuration reference for the SuiteCRM 8.7.0 and later settings. If the cluster is managed by the Keycloak Operator, the same client can be declared as a KeycloakSAMLClient resource, with the operator set to manual approval mode so that operator updates do not upgrade Keycloak without review. Check: the client appears in the realm's client list with the expected hostname in every URL field, and the Keycloak metadata endpoint for the realm returns an identity provider descriptor.

  2. Generate the service provider certificate and key

    The SuiteCRM administrator generates the service provider certificate and private key that SuiteCRM will use to sign requests and, where the Keycloak client requires it, the matching public certificate for the client configuration. Keep the private key out of the repository, shared drives and chat tools, and record which person created it and when. Check: the certificate has a validity period that your security team has approved, and the public part is available to upload to Keycloak while the private part stays only in the administrator's secure working location until the next step.

  3. Store the certificate and key as Symfony secrets

    Using the SuiteCRM command line on the staging host, the administrator runs php bin/console secrets:set for the certificate and the private key, then references each secret in the SAML environment settings as an env value rather than a literal string. The SuiteCRM documentation for Symfony secrets describes this pattern. Check: the secrets:list command shows the new entries, and a test request to the SuiteCRM environment resolves the references without an error about a missing secret. Confirm the decryption key location with the platform owner so that backups and deployments can restore it.

  4. Set AUTH_TYPE to saml and the environment values

    The administrator sets AUTH_TYPE to saml in the environment file for the staging instance and fills in the SAML values from the 8.7.0 and later configuration reference, including the identity provider metadata or entity settings from the Keycloak realm, the service provider entity ID, and the references to the secrets stored in the previous step. Change one environment at a time, and keep a copy of the previous working login settings so the change can be reversed. Check: the SuiteCRM login page redirects to the Keycloak sign-in screen for the staging realm, and the redirect carries the expected client ID and entity ID.

  5. Align the NameID and attribute mapping with SuiteCRM usernames

    The identity administrator confirms which Keycloak user attribute is sent as the NameID and which attributes are sent for the email address and name, then compares those values with the usernames already stored in SuiteCRM for the pilot users. SuiteCRM matches the incoming identity to an existing account, so a mismatch in case, domain suffix or format can create a second user or deny access. Check: for each pilot user, the value received from Keycloak matches exactly one existing SuiteCRM user record, and the team has written down the mapping rule for the next person who maintains the realm.

  6. Test with pilot accounts on staging before cutover

    The project team signs in with a small set of pilot accounts covering the roles that matter for access, such as an administrator, a sales user and a service user, and checks that each reaches the expected SuiteCRM home page with the right permissions. Test logout as well: the SuiteCRM 8.7.0 and later SAML implementation does not support IdP-initiated logout or POST binding to the logout service, so signing out of Keycloak does not end the SuiteCRM session. Write this limit into the user guidance before rollout. Check: every pilot account logs in and out as documented, the audit or login records show the expected identities, and the team has signed off the results before any production user is moved.

How Keycloak attributes map to SuiteCRM user accounts

This table compares each identity field Keycloak sends in the SAML assertion with the SuiteCRM user field it must match, the risk if it does not, and who owns the value. Read it before the mapping is agreed, because a single mismatch can create a second account or block sign-in. Confirm the exact attribute names and matching rule in the SuiteCRM 8.7.0+ SAML configuration reference before you configure either side.

Identity fieldSuiteCRM user field it must matchRisk if the match failsValue owner
Username or NameIDSuiteCRM username used for loginSign-in fails or a new user is created beside the existing accountKeycloak admin
Email addressSuiteCRM user email addressExisting users may not be found, so duplicate accounts appearHR system
Given and family nameSuiteCRM first and last name on the user recordRecords show the wrong owner name in activity and audit viewsHR system
Group or role claimsSuiteCRM role assignment, if mappedUsers get too much or too little access after sign-inSuiteCRM admin
Account enabled stateSuiteCRM user statusLeavers keep access, or active staff are locked outHR system
Certificate and metadata valuesSAML trust settings in environment secretsAll sign-ins fail after a certificate changeSuiteCRM admin
Attribute names and matching ruleSAML configuration settings in the 8.7.0+ referenceSilent mismatch that only shows up in testing with real accountsSuiteCRM admin

Keeping SAML certificates and private keys in Symfony secrets

SuiteCRM documents storing SAML certificates and private keys as Symfony secrets, set with php bin/console secrets:set and referenced as env values, so that key material is not sitting in plain environment files that get copied between servers, backups and support tickets. The practical effect is that each environment holds its own encrypted secret store and decryption key, and the people who can read those keys are a deliberate decision you should record. Decide who may run secrets:set on production, who holds the production decryption key, and whether staging and production share anything at all. Shared keys mean a staging compromise exposes production sign-on, so most teams keep them separate, with a named owner for each and a documented way to recover the key if that person leaves.

A rotated service provider certificate has to move through the same path as any other change. Generate the new certificate and private key, load them into the staging secret store, point the staging SAML settings at them, and then test a full sign-in and sign-out cycle before anything reaches production. Confirm which secret names and env references change, and check that the old values are removed from any local .env.local copies. Because the certificate you publish to Keycloak must match the private key SuiteCRM signs with, the Keycloak client update for the new certificate has to be scheduled in the same change window, not after it. Keep the old certificate in place on the Keycloak side until the new one has been verified, and confirm with your SuiteCRM and Keycloak administrators how that overlap is handled in your environment.

Plan the rotation as a change with a rollback path rather than a routine task. Before the window, record the current secret names, the Keycloak client identifier, the certificate fingerprint and the person authorized to approve the switch. During the window, confirm that the SuiteCRM login page still offers SAML sign-in and that a test user lands in the correct account. If sign-in fails, the fastest recovery is usually to restore the previous certificate on both sides together, which is only possible if the previous secret value and the previous Keycloak certificate were kept. The SuiteCRM 8.7.0+ SAML configuration reference is the document to check for the exact settings and any behavior that changes with the certificate, and it is the first read for your SuiteCRM administrators.

Security controls for SuiteCRM SAML sign-on with Keycloak

These controls keep the Keycloak sign-on path for SuiteCRM contained, traceable and recoverable. Each one covers a different part of the setup: client and certificate scope, URL handling, administrator access, key lifecycle, monitoring and the fallback path when the identity provider is unavailable. Confirm every setting against the SuiteCRM and Keycloak references before you rely on it.

Separate clients and certificates per environment

Create a distinct Keycloak SAML client and its own signing material for each SuiteCRM environment, such as development, staging and production. A copy of a production client in a test instance lets test users sign in to production data, and a shared certificate means one compromised key affects every environment. Keep the SuiteCRM certificates and private keys in Symfony secrets for each environment, and confirm the client settings against the SuiteCRM 8.7.0+ SAML configuration reference.

SAML configuration reference

HTTPS and exact SAML URLs

Every redirect, assertion consumer and logout URL must use HTTPS and match the SuiteCRM hostname exactly. Loose wildcards or mismatched hosts in Keycloak client settings widen the set of places a SAML response can be delivered. Check the SuiteCRM base URL, the entity identifier and the assertion consumer path against the values in the SuiteCRM environment file, and retest after any hostname or proxy change.

Least-privilege Keycloak realm administrators

Give each person only the realm roles they need to manage SuiteCRM clients, and keep a small set of named administrators rather than shared accounts. Separate the people who change SAML clients from those who manage users and groups. Review administrator membership on a set schedule and remove accounts that no longer need access. Confirm the role model against the Keycloak server administration guide.

Keycloak admin guide

Tested certificate and key rotation

Plan certificate and key rotation as a scheduled change with a rehearsal on staging before production. Generate the new material, update the Keycloak client and the SuiteCRM secret, then confirm that a fresh sign-in succeeds before retiring the old key. Record the cutover steps, the owner and a rollback plan. Store the old material securely until the rollback window closes, and confirm the secret commands with the SuiteCRM Symfony secrets reference.

Audit events and login failure metrics

Enable Keycloak event logging and metrics so that failed SAML logins, client errors and administrator changes are visible to the security team. Forward the events to the log platform your organization uses and set an alert on repeated failures for the SuiteCRM client. Confirm which event types and metric endpoints your Keycloak version exposes in the observability and production configuration documents before you build alerts on them.

Keycloak metrics guide

Documented local admin recovery path

Keycloak or the network path to it can fail, and SAML-only login then locks out every SuiteCRM user. Decide in advance which SuiteCRM administrator accounts can sign in without the identity provider, and confirm how the SuiteCRM AUTH_TYPE setting is changed for an emergency. Store the recovery steps, credential custody and approval rules in a runbook, and test the switch in staging. Logging out at Keycloak does not end the SuiteCRM session, so include that limit in user guidance too.

What users see at logout and sign-out

When a user chooses sign out inside SuiteCRM, the CRM closes its own session in that browser and returns the user to the sign-in page. Whether the Keycloak session also ends depends on which logout bindings the SAML integration supports for requests that start in SuiteCRM, so confirm the exact behavior in your build before you write user guidance. The 8.7.0+ SAML configuration reference documents the limits on logout, and that is the page to check against your test results.

  • Local session ends: The SuiteCRM session is closed in that browser, so the next visit to SuiteCRM requires a new sign-in.
  • Keycloak session may remain: Keycloak can keep its own SSO session, so the next SAML sign-in may complete without a password prompt. Confirm this with your realm session settings.
  • Other tabs stay open: Other browser tabs holding an earlier SuiteCRM page can still show data until the session expires or the page reloads. Test this behavior and tell users to close those tabs.
  • Shared computers: Ask users on shared workstations to close the browser after signing out, because closing SuiteCRM alone may not stop the next person from reaching Keycloak-protected applications.

Check this by signing in, signing out of SuiteCRM, then opening a new private window and recording whether Keycloak asks for credentials.

Why SAML sign-on to SuiteCRM fails and how to fix it

This table lists the failures teams most often hit when wiring SuiteCRM 8.7 or later to Keycloak over SAML, with the likely cause and the fix for each. Work down the rows in order, since a missing AUTH_TYPE setting or an unloaded certificate hides every later check. Confirm each fix against the SuiteCRM and Keycloak versions you run, and read both sets of logs before changing settings.

FailureLikely causeFix
Login screen still shows the default formAUTH_TYPE is not set to saml in the environment file, so SuiteCRM never starts the SAML login flow.Set AUTH_TYPE to saml in the environment settings, clear the cache, and reload the login page.
SAML fails at startup or on the first login attemptThe certificate or private key was not stored with secrets:set, or the environment value does not resolve to the stored secret.Re-run the secrets command for each value, check the secret name matches the reference exactly, and confirm the value loads in the environment used by the web server.
Keycloak reports an invalid request or unknown clientEntity ID or assertion consumer service URL in the Keycloak client differs from the values SuiteCRM publishes.Compare both sides character by character, including trailing slashes, the path and the protocol, then update the Keycloak client to match SuiteCRM's metadata.
Assertion rejected with a timing or validity errorClock skew between SuiteCRM and Keycloak hosts, or the SuiteCRM site is served over a different scheme or host name than the one Keycloak expects.Synchronize time on both hosts with NTP, and make the public URL, scheme and host name identical in SuiteCRM settings and the Keycloak client.
User signs in at Keycloak but SuiteCRM shows an access or account errorThe username attribute sent in the assertion does not match the user name of an existing SuiteCRM user.Pick one attribute as the identifier, map it in the Keycloak client, and make sure the SuiteCRM user name matches that value. Test with one account before moving others.
Signing out at Keycloak leaves the SuiteCRM session activeSuiteCRM 8.7.0 and later do not support IdP-initiated logout or POST binding to the logout service.Tell users to log out of SuiteCRM directly and plan for session lifetime in the design. Confirm current logout behavior in the configuration reference for your version.
Logout from SuiteCRM does not reach KeycloakThe single logout settings on either side are incomplete, or the logout endpoint is not configured in the Keycloak client.Review the logout endpoints on both sides against the SAML configuration reference, then test a full sign-out in a staging instance.
Failures appear only after an upgradeThe SAML dependency or environment keys changed between SuiteCRM releases, so older settings no longer apply.Compare your settings with the release notes for the target version, retest on staging, and check both sets of logs for new warnings.

How much does SuiteCRM SSO with Keycloak cost and how long does it take?

What makes SuiteCRM SSO with Keycloak take more or less effort?

The effort depends mostly on how many environments need sign-on, how mature your Keycloak setup already is, and how much cleanup the user base needs. Each environment (production, staging, test) needs its own SAML client, certificate handling and matching checks, so three environments take roughly three times the verification work of one. A team that already runs Keycloak with clean realms and existing SAML clients moves faster than one that is installing Keycloak for the first time. Keycloak deployed as a clustered service or through the Keycloak Operator adds work on the identity side, because changes must be tested against the cluster and the Operator's update approval settings. Certificate handling and username matching are the other large drivers, since mismatched usernames cause the most failed logins during a pilot. Ask your team to inventory these four items before requesting a quote.

What is one-time work and what recurs after SuiteCRM SSO goes live?

The first build is one-time: configuring the Keycloak SAML client, setting the SAML environment values in SuiteCRM, storing service provider certificates and keys as Symfony secrets, testing username matching and documenting the logout limits. Recurring work follows from that setup. Certificates and keys need rotation on a schedule you set, and each rotation requires updating the Keycloak client and the Symfony secret together. SuiteCRM minor 8.x releases arrive roughly every eight weeks, so SAML settings must be retested after each upgrade. Keycloak also ships four minor releases a year, so the identity side needs its own upgrade and regression checks. Monitoring of login failures and Keycloak metrics is ongoing. Ask for the recurring tasks to be listed separately from the build in any quote.

What does your team need to provide for the SSO project?

You need four roles and one test environment. An identity administrator owns the Keycloak realm, the SAML client and the user directory. A SuiteCRM administrator owns the application settings, the environment values and the user records that must match. Someone with authority over the certificates and secrets must approve where keys are stored and who can run the secrets commands. A staging SuiteCRM instance is needed so that login changes never reach production first. Finally, a pilot group of real users, drawn from several teams, should test sign-in, sign-out and account matching before everyone is moved over. Confirm these people and their availability in writing before work starts, because a missing identity administrator is the most common cause of delay.

Can our own team set up SuiteCRM SSO with Keycloak without outside help?

Yes, a team can do this alone if it has hands-on SAML experience, access to a Keycloak administrator account and the SuiteCRM documentation. The SuiteCRM 8.7.0+ SAML configuration reference and the Keycloak administration guide cover the settings. The points that usually need outside review are certificate storage, because a leaked private key undermines the whole login setup, and the logout behavior, because users must understand that signing out at Keycloak does not end the SuiteCRM session. A team without SAML experience should plan time to learn the protocol on a test system first. Whether you build it yourselves or with DeployOpen, the test plan, the pilot group and the rollback steps should be written before the production change.

What should we ask for in a written quote for SuiteCRM SSO with Keycloak?

Ask for a fixed scope that lists each environment covered, the Keycloak deployment type (single server, clustered or Operator-managed), the SuiteCRM version and the SAML bundle it uses, and how certificates and keys will be stored as Symfony secrets. The quote should name the username matching review, the list of user accounts checked, and the pilot group size and test cases. Request a clear list of deliverables, such as configuration notes, a runbook for certificate rotation and a user-facing note on logout limits. Ask which items are one-time and which are recurring, what happens if SuiteCRM or Keycloak releases an upgrade during the project, and what acceptance criteria close the work. DeployOpen agrees scope, deliverables and timelines in writing before work starts, and a quote follows from that written scope.

Does Keycloak SAML SSO need an ongoing support retainer after launch?

Not always, but it helps to decide this before launch. A retainer covers upgrades, continuous checks and support requests on a set schedule. Without one, your team must own certificate rotation, SuiteCRM and Keycloak upgrade testing, and responses to login incidents. The decision depends on how often your SuiteCRM and Keycloak versions change, how many environments are in use and how quickly you need help when a login breaks. Ongoing support and upgrades are available from DeployOpen as retainers, and their terms are set in writing. Ask any partner to state which recurring tasks are included, how urgent issues are handled and how each upgrade will be tested against your SAML settings.

How DeployOpen works on this

DeployOpen plans and implements SuiteCRM single sign-on with Keycloak over SAML inside your own infrastructure, so your identity and security teams can review each setting before users depend on it. The work starts with a written scope that names the Keycloak realm, the SuiteCRM environments and the logout behavior your users will accept.

How we scope

  • Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.
  • The written scope lists each SuiteCRM environment, the Keycloak realm and client set, and the users covered by SAML login.
  • Scope records how Keycloak username attributes will match SuiteCRM usernames, and who approves that mapping.
  • A quote follows from the written scope, so you can see which items are one-time work and which recur.

How we build

  • We configure the SAML environment settings in SuiteCRM 8.7 or later and test them in a staging instance first.
  • Service provider certificates and private keys go into Symfony secrets, set with the console command and referenced from env values.
  • We confirm the Keycloak SAML client settings, signing and encryption choices, and the attribute mapping against the SuiteCRM configuration.
  • We test login for each role, failed logins, and users whose Keycloak username does not match an existing SuiteCRM account.

How we hand over

  • You receive documentation of the final settings, the secrets inventory and the Keycloak client configuration.
  • The handover explains the logout limits to end users, including that ending a Keycloak session does not end the SuiteCRM session.
  • Your administrators get a runbook for certificate rotation, adding environments and checking the login path after upgrades.
  • Test results and the retest record are delivered so your compliance team can review the evidence.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers after handover.
  • Retainer support can cover SuiteCRM minor releases and Keycloak version changes that affect the SAML client settings.
  • Keycloak operator updates and database migration steps can be planned with your team before they are applied.
  • Support scope, response expectations and review points are agreed in writing, not assumed.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.