Identity Provider: Keycloak
Keycloak is an open-source solution for sophisticated identity and access management.
It offers 4 user management options:
Integrated user management (internal)
OIDC (OpenID Connect)
SAMLv2 (Security Assertion Markup Language 2.0)
LDAP (Lightweight Directory Access Protocol)
Keycloak has its own user directory, but it is also possible to integrate SAMLv2 and LDAP/S.
Please find below the configuration instructions for OIDC, SAMLv2, and LDAP.
To configure an OIDC user-managed setup, please follow the steps below:
Open keycloak.
Go to Identity Providers.
Click Add Provider.
Select OpenID Connect v1.0.
Enter the following configuration parameters:
Note down the Redirect URI
Set Alias to oidc
Store Tokens to ON
Trust Email to ON
Account Linking Only to OFF
Hide on Login Page to OFF
Sync Mode to force
In the Import External IDP config section at the bottom of the page:
import the .well-known/openid-configuration endpoint via Import from URL
Change the Client Authentication
Insert the following parameters from your provider into the OpenID Connect Config:
Client Authentication, use Client secret send as post if you are unsure.
Client ID
Client Secret
Click Save.
The OpenID setup is now complete.
To configure a SAMLv2 user-managed setup, please follow the steps below:
Open keycloak.
Go to Identity Providers.
Click Add Provider.
Select SAML v.2.0.
Enter the following configuration parameters:
Note down the Redirect URI
Set Alias to azuread
Display Name to Azure AD
Store Tokens to ON
Stored Tokens Readable to ON
Trust Email to ON
Account Linking Only to OFF
Hide on Login Page to OFF
Sync Mode to force
Create a SAML connector on the provider side with the Redirect URI from the last step
Insert the following parameters from your provider:
Service Provider Entity ID
Single Sign-On Service URL
Single Logout Service URL; set the Principal of the user (example from Azure AD)
NameID Policy Format to Persistent
Principal Attribute to ON (http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name)
Allow create to ON,
HTTP-POST Binding Response to ON
the rest to OFF
If you want a validated signature:
Validate Signature to ON
Validating X509 Certificates should be the certificate in PEM format
Click Save.
Additional mappers are needed for user mapping: Click on the Mappers tab.
To create an e-mail mapper, click Create. The following attributes have to be set exactly as follows:
Name to email
Sync Mode Override to inherit
Mapper Type to Attribute Importer
Attribute Name to http://schemas.xmlsoap.org/ws
User Attribute Name to email
Click Save.
To create the firstName mapper, click Create. The following attributes have to be set exactly as follows:
Name to firstName
Sync Mode Override to inherit
Mapper Type to Attribute Importer
Attribute Name to http://schemas.xmlsoap.org/ws
User Attribute Name to firstName
Click Save.
To create the email lastName mapper, click Create. The following attributes have to be set exactly as follows:
Name to lastName
Sync Mode Override to inherit
Mapper Type to Attribute Importer
Attribute Name to http://schemas.xmlsoap.org/ws
User Attribute Name to lastName
Click Save.
The SAMLv2 setup is now complete.
To configure an LDAP user-managed setup, please follow the steps below:
Open keycloak.
Go to User Federation.
Click Add Provider.
Enter the following configuration parameters:
Console Display Name you would like to use
Set Import Users to ON
Edit Mode to UNSYNCED
Sync Registrations to OFF
Vendor to your vendor (or other for OpenLDAP)
Username LDAP attribute to email
Further configurations you have to make to fit your LDAP configuration. Save and Synchronize all users.
Create two LDAP Groups, one for Users and one for Admins
Add the RED_MANAGER value as an additional LDAP attribute to the user group.
Add the RED_ADMIN value as an additional LDAP attribute to the user group.
We suggest that you fill in the description field.
Additionally, a role-LDAP-mapper is needed
Click on the Mappers tab.
Click Create.
The following attributes have to be set exactly as described below:
Mapper Type to role-ldap-mapper
Role Name LDAP Attribute to description
Mode to READ_ONLY
User Roles Retrieve Strategy to LOAD_ROLES_BY_MEMBER_ATTRIBUTE
Use Realm Roles Mapping to ON
Further configurations you have to make to fit your LDAP configuration.
Save and Sync LDAP Roles To Keycloak.
The LDAP setup is now complete.