Configure: Secure Access (ESA) with Keycloak as IdP
Learn how to configure the Secure Access using another Keycloak as identity provider
Configure: Secure Access (ESA) with Keycloak as IdP
Learn how to configure the Secure Access using another Keycloak as identity provider
How to Configure Authentication for Keycloak
This article contains instructions for configuring Secure Access component to be able to authenticate Customers end-users to Matrix42 Pro and IGA solutions (like for example IGA, ITSM etc.), using Keycloak as identity provider.
Configurations by Customer to IdP Keycloak
Customer need to create OpenID Connect Client to their IdP Keycloak, in order for it to work as IdP for Secure Access.
- Login to IdP Keycloak
- Select correct Realm
- Go to
Clients -
Create client
Select client typeOpenID Connect
Set descriptiveClient ID
Click Next

- Set
Client authenticationOn
Click Next

- Set Valid redirect URIs and Valid post logout redirect URIs
Set Valid redirect URIs by copying Redirect URI from Secure Access Identity provider which you create on next chapter. So you need to set this Valid redirect URI together with Matrix42 when they know it from Secure Access side.
Set Valid post logout redirect URIs, to be for example your company home page.
Web origins should be set automatically, if not, set it correctly manually.

Step-by-Step Instructions
- Add customers Keycloak https certificate to Secure Access (ESA) keystore
Add customers Keycloak https certificate to Secure Access (ESA) keystore, to enable Secure Access connect to customers Keycloak. This can be done only by Matrix42 persons, as access to host is needed for this. See guidance: https://docs.efecte.com/internal-configuration-instructions/iga-faq chapter How to add certificate to ESA.Note
If this certificate is not installed before continuing to next steps, Secure Access is not able to fetch information from IdP Keycloak using
discovery endpointurl.
- Login with ESA Admin (main.admin) to URL domain.com/auth/admin
- Select correct realm from the left top corner

- Open Identity Provider settings from the left side panel

- Add new provider by selecting
Keycloak OpenID Connect

- Name identity provider (as you want)

- Add URLs for authentication.
It is recommended to use discovery endpoint of IdP Keycloak to auto populate those url's with correct values. Customer should give this url, it is on format: https://customeridpkeycloak.com/auth/realms/REALMNAMEHERE/.well-known/openid-configuration
To use discovery endpoint, setUse discovery endpointto On and set correct url.
After that those url's are auto populated.
- Optional: Validate signatures can be enabled, customer provides the URL for JWKS

- Add Client secret and password (customer provides these from IdP Keycloak)

- Scroll down and choose Add button (it saves the identity provider)
- Check these settings from Identity provider you just created

- Set Do not Store Users to On

13. After above configuration is done, a new login button appears on the ESA login page, that fordwards you to customers Keycloak login page
14. Test Login and Logout with more than one account
Secure Access (ESA) mappers configuration
After using new button to login, below screen is visible on the screen, it means, ESA needs further configuration for the mappers.
In order to pass the User from ESA to other systems (ESM, ESS, IGA) - ESA must be aware of context of the User. For that purpose, ESA stores a bit of metadata, describing each User which attempted to login.
Screen above is showing, because ESA is unable to retrieve all of the needed data from Identity Provider and it is asking the User to manually input all required data.
We can overcome that, and prepare an automation which will automatically map attributes with data coming from the IdP Keycloak, to attributes required by ESA User.
- Login with ESA Admin (main.admin) to URL domain.com/auth
- Open Identity Provider settings from the left side panel
- Select Identity provider you did for this Keycloak authentication on previous steps
- Go to
Mapperstab. Here is an example of how they should be defined.
Use same attribute names and friendly names as they have been configured to Keycloak being IdP.
Mappings can differ between different environments, so it is also important to discuss what claims IdP Keycloak is sending and how those should be mapped.
Following three example mappings work in case where IdP Keycloak email claim can be set to email, upn and username attributes.
- For email use the mapper type
Attribute Importerand Sync mode overrideForce.

- For username use the mapper type Username
Attribute Importerand Sync mode overrideForce.

- For upn use the mapper type Username
Attribute Importerand Sync mode overrideForce.

After these steps:
- Make sure that a Person datacard is created in ESM.
- Make sure that Person has right value in servlet.auth.person.uid.attribute.code - it will be used later on, as a login name.
Validate/set that you have configured logout url correctly to scc and/or esm depending on where users are going with this authentication.
When above steps are completed, during login process, ESM will create missing User object, link it with already existing Person - and proceed to startup page of ITSM for given role.
Keycloak OpenID Connect Identity provider example





Troubleshooting
If you see this screen after authenticating against IdP Keycloak

Then issue is most likely that claims mappings doesn't match between Secure Access and IdP Keycloak. Check/fix configurations on both sides.
If you see this screen after authenticating against IdP Keycloak, it means that Secure Access needs further configuration for the mappers. Check also Claim configurations on IdP Keycloak side.

Table of Contents