Explore documentation
Keycloak SSO
Learn how to connect your Keycloak realm with Better Stack to enable single sign-on (SSO) for you and your colleagues.
SSO setup
- Go to Single Sign-On configuration.
- Click Connect on the Generic SAML SSO panel and select Keycloak.
- Note the Entity ID. You will need it in a moment.
In Keycloak
- Sign in to your Keycloak admin console.
- Select the realm you want to connect to Better Stack.
- In the left menu, go to Clients and click Create client.
- Enter the following:
- Client type: SAML
- Client ID: The Entity ID from Better Stack.
- Name: Any name (e.g.,
Better Stack).
- On the next page, for Valid redirect URIs, enter
https://betterstack.com/*. - On the next page, enable the Sign assertions option.
- Go to the Keys tab and disable the Client signature required option.
- Go to the Client scopes tab and click on the scope with your Entity ID in its name.
- Click Add predefined mapper and select X500 email, X500 givenName, and X500 surname. Click Add.
- Click X500 email and change SAML Attribute Name to
email. - Click X500 givenName and change SAML Attribute Name to
first_name. - Click X500 surname and change SAML Attribute Name to
last_name. - In the left menu, click Realm settings.
- At the bottom of the page, click SAML 2.0 Identity Provider Metadata. This will open an XML file.
- Copy the content of the
<ds:X509Certificate>element. - Copy the
Locationattribute (URL) from the<md:SingleSignOnService>element whereBindingisurn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST.
In Better Stack
- Paste the certificate content into the X.509 Certificate field.
- Paste the URL into the Identity Provider Single Sign-On URL field.
- Click Connect. You will be redirected to Keycloak to sign in.
You're done. Your Keycloak Single Sign-On is now configured.