Overview
While not officially supported in their documentation, KnowBe4 can utilize Keycloak’s SAML endpoints for Single Sign On.
There are, however, a few extra steps in order to get the information both parties need.
Initial Keycloak Configuration
- Create a new SAML client in your authentication realm
- Set the Client type to
SAML - Set the Client ID to
KnowBe4
- Once created, scroll down to
SAML capabilitiesand set the following:
- Set
Name ID formattoemail - Enable
Force name ID format
- Scroll down to
Signature and Encryptionand set the following:
- Enable
Sign documents - Enable
Sign assertions
You may leave other settings blank for now, we will collect the information in the following steps
- We need to collect the following information from our Keycloak server:
- The SAML target for your realm
- The fingerprint of the SAML certificate
SAML Target
- Navigate to
Realm settings - Select the
Generaltab - Look for
Endpointsand clickSAML 2.0 Identity Provider metadata - Copy the URL of any of the
md:SingleSignOnServicefields, they are all identical and save this for later

Certificate Fingerprint
- While still on the XML screen from above, copy the contents of the
ds:X509Certificatesection to a file, such as /tmp/kc.pem - Edit this file to include:
-----BEGIN CERTIFICATE-----before the certificate data-----END CERTIFICATE-----after the certificate data
- Generate a sha256 fingerprint by running:
openssl x509 -in /tmp/kc.pem -noout -fingerprint -sha256
- Copy this fingerprint and save it for later
- Save your changes
Initial KnowBe4 Configuration
For now, do NOT click Enable SAML SSO, we are not ready for it yet
- Log into training.knowbe4.com
- Click on your email in the upper right corner and click on
Account Settings - Expand
Account Integrationsand clickSAML - Enable
Allow Account Creation from SAML Login - Enter the SAML target URL from earlier into
IdP SSO Target URL - Set
IdP Cert FingerprinttoSHA-256and paste the fingerprint we generated earlier. - Enable
Sign SP AuthnRequest - Optionally enable
Enable SP AuthnRequest Expiration Notifications
- This way you can receive notifications to rotate your client certificates in Keycloak
- Download the
Current AuthnRequest Certificateand save the .cer file for later - Copy following URLs and save them for later:
- SSO Sign-in URL
- SSO Sign-out URL
- SSO Callback URL
- Bypass-SSO Login URL
- Don’t forget to click
Save Changes

Followup Keycloak Configuration
Now that we have all the necessary information from KnowBe4, we can finish setting up our Keycloak Client:
- Navigate back to your KnowBe4 client in Keycloak
- Under Access Settings, set the following:
- Set
Valid redirect URIsto the SSO Callback URL you saved earlier - Set
IDP-Initiated SSO URL nameto the SSO Sign-in URL you saved earlier
- Click to enter the
Advancedtab and set the following:
- Set
Logout Service Redirect Binding URLto the SSO Sign-out URL you saved earlier
The last thing we need to do is convert and import the certificate we downloaded from Knowbe4 earlier. Before we can upload it to Keycloak, we must convert it from binary DER format to ASCII PEM format:
- Navigate to where you saved the .cer file from earlier.
- Convert it to PEM by running the following:
openssl x509 -in Knowbe4-AuthnRequest-Current-202507221129.cer -inform der -out knowbe4.pem
We can test to ensure the certificate was properly converted by running the following:
openssl x509 -in knowbe4.pem -text
If successful you should see valid certificate Issuer, Validity, and Subject information.
The Certificate at the bottom of the output should also match the text in the Current AuthnRequestCertificate box on KnowBe4

To install the certificate in Keycloak, do the following:
- Click to enter the
Keystab of your client - Ensure
Client signature requiredis checked - Click Import Key
- Set
Archive formattoCertificate PEM - Drag or Browse to the file we generated earlier (knowbe4.pem)
- Click Import

Both Keycloak and KnowBe4 should now be fully configured for SAML SSO
Testing SSO
We are finally ready to test our SAML Logins to KnowBe4. As a safety precaution, we will use two windows, one will stay logged into the admin console and the other we will use to test SAML.
- Navigate back to your KnowBe4 SAML settings
- Open a private browsing window
- In your non-private window, click
Enable SAML SSO - Save your changes, DO NOT LOG OUT
- In your private browser window, navigate to
training.knowbe4.com - Enter your email address
You should now be redirected to your Keycloak server for login.
If all goes well, you can optionally click Disable non-SAML Logins for All Users and log out.
Troubleshooting
While this is certainly not every failure scenario, this should cover the most common SAML issues
Not Redirected to Keycloak
- Make sure the
IdP SSO Target URLfield is correct in KnowBe4
Keycloak says Invalid Request
Check your Keycloak logs for the following:
WARN [org.keycloak.events] (executor-thread-35451) type="LOGIN_ERROR", realmId="redacted", clientId="null", userId="null", ipAddress="redacted", error="client_not_found", reason="Cannot_match_source_hash"
- Check your client’s ClientID and make sure it says
KnowBe4or the contents of theEntity IDfield on KnowBe4’s SAML settings page
ERROR [org.keycloak.protocol.saml.SamlService] (executor-thread-35451) request validation failed: org.keycloak.common.VerificationException: org.keycloak.common.VerificationException: Invalid query param signature
at org.keycloak.protocol.saml.SamlProtocolUtils.verifyRedirectSignature(SamlProtocolUtils.java:179)
at org.keycloak.protocol.saml.SamlProtocolUtils.verifyRedirectSignature(SamlProtocolUtils.java:144)
at org.keycloak.protocol.saml.SamlService$RedirectBindingProtocol.verifySignature(SamlService.java:818)
at org.keycloak.protocol.saml.SamlService$BindingProtocol.handleSamlRequest(SamlService.java:304)
at org.keycloak.protocol.saml.SamlService$BindingProtocol.execute(SamlService.java:702)
at org.keycloak.protocol.saml.SamlService.redirectBinding(SamlService.java:870)
at org.keycloak.protocol.saml.SamlService$quarkusrestinvoker$redirectBinding_redacted.invoke(Unknown Source)
at org.jboss.resteasy.reactive.server.handlers.InvocationHandler.handle(InvocationHandler.java:29)
at io.quarkus.resteasy.reactive.server.runtime.QuarkusResteasyReactiveRequestContext.invokeHandler(QuarkusResteasyReactiveRequestContext.java:141)
at org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.run(AbstractResteasyReactiveContext.java:145)
at io.quarkus.vertx.core.runtime.VertxCoreRecorder$14.runWith(VertxCoreRecorder.java:576)
at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538)
at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29)
at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: org.keycloak.common.VerificationException: Invalid query param signature
at org.keycloak.protocol.saml.SamlProtocolUtils.verifyRedirectSignature(SamlProtocolUtils.java:176)
... 16 more
- Make sure that the certificate you uploaded to the
Keyssection in Keycloak matches theCurrent AuthnRequest Certificatecertificate in KnowBe4
Login Fails after Successful Keycloak Login
- Make sure that the fingerprint you set for
IdP Cert Fingerprintis correct