MS Entra ID (SAML v2.0)
Prerequisites
Permissions required for registering and configuring an app in Microsoft Entra ID.
The account must have permission to manage applications in Microsoft Entra ID. Ideally the account should be in the Global Admin role to grant admin consent.
Implement Single Sign-On (SSO)
It is recommended to use two separate browser tabs for the Azure (A) and Keycloak (K) portals to make it easier to apply the settings.
(K) Open a new tab in your browser and login to the target Spark tenant. Access the Keycloak console from the User menu.
(K) Login to the Keycloak Admin Console using your admin credentials.
(K) Click Identity Providers from the left pane.
(K) Expand the Add provider dropdown and choose SAML v2.0.
(K) Fill in values for the Alias and Display Name fields. The Alias should be a lowercase name without special symbols. Please note this Display Name will appear in the button on the Spark login page.
(K) Copy the Redirect URI value.
(A) In a second browser tab, sign in to Azure Portal.
(A) Navigate to Microsoft Entra ID -> Enterprise Applications -> All applications.
(A) On the All applications page, click on New application.
(A) Click on Create your own application.
(A) Type a name for your application.
(A) In the section What are you looking to do with your application?, select Integrate any other application you don't find in the gallery.
(A) Click Create.
(A) On the Overview page, in the Getting Started area, click on Set up single sign on.
(A) In the Select a single sign-on method area, select SAML.
(A) On the Set up Single Sign-On with SAML page, in the Basic SAML Configuration area, click Edit.
(A) Under the Basic SAML configuration, configure the following settings:
In Identifier (Entity ID), click on Add identifier, use the Redirect URI copied earlier and remove everything after the tenant name, i.e.
https://keycloak.{environment}.coherent.global/auth/realms/{tenant}.Click on Add reply URL and paste the edited Redirect URI into the Reply URL (Assertion Consumer Service URL), i.e.
https://keycloak.{environment}.coherent.global/auth/realms/{tenant}/broker/{alias}/endpoint.Leave the default values for other fields and click Save.
(A) In the SAML Certificates Token signing certificate section, copy the App Federation Metadata Url. You will use this link when creating an Entra ID SAML provider on Keycloak.
(A) Click on Users and groups in the left pane.
(A) Click on the Add user/group to add the users and groups that will use Spark.
(K) Return to Keycloak. Paste the App Federation Metadata Url into the SAML entity descriptor field.
(K) Click the Add button.
(K) In NameID policy format, select Email.
(K) Click Save.
(K) Click on the Mappers tab and then click on Add mapper.
(K) Create 3 mappers with the following properties:
- KeyValue
Name
firstNameSync mode override
ForceMapper type
Attribute ImporterAttribute Name
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givennameName Format
ATTRIBUTE_FORMAT_BASICUser Attribute Name
firstName - KeyValue
Name
lastNameSync mode override
ForceMapper type
Attribute ImporterAttribute Name
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surnameName Format
ATTRIBUTE_FORMAT_BASICUser Attribute Name
lastName - KeyValue
Name
emailSync mode override
ForceMapper type
Attribute ImporterAttribute Name
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddressName Format
ATTRIBUTE_FORMAT_BASICUser Attribute Name
email
For SAML SSO, it is important to validate signatures to prevent unauthorized access. For more information see Importance of validating signatures in SAML.
(K) For the identity provider you have setup, scroll down to Signature and Encryption settings.
(K) Enable the option Validate Signature.
Navigate to your Spark tenant and sign in using the newly created provider. There will be a button on the Keycloak login page with the display name defined earlier.
Setup users against user groups
In the documentation below, we describe how Spark user group assignment can be done with either Entra ID app roles or Entra ID groups.
App roles: Use app roles when you need fine-grained, application-specific permissions. This is ideal for defining what users can do within a specific application.
Groups: Use groups for broader access management that spans multiple applications and resources. This is useful for organizational roles like departments, teams, or project groups where access to various resources needs to be managed collectively.
Scope
Specific to an application
Cross-application
Management
Defined in the application's manifest
Managed in Microsoft Entra ID
Assignment
Assigned to users or groups
Users are added to groups
Granularity
Fine-grained, application-specific roles
Broader, resource-wide access control
Dynamic Membership
No
Yes
Use Case Example
Role-based access within a single app
Access control across multiple resources
Configure Entra ID app roles to Spark user groups
It is recommended to use two separate browser tabs for the Azure and Keycloak portals to make it easier to apply the settings. In this guide, we will setup the automatic roles for the tenant-admin role.
(A) In the first tab sign in to Azure Portal.
(A) Search for and select Microsoft Entra ID.
(A) Select App registrations, then select the application you previously created and click App roles.
(A) Select Create app role.
(A) Provide the following values and then click Apply.
KeyValueAllowed member types
User/GroupsDisplay name
tenant-adminValue
tenant-adminDescription
Your app role description
Do you want to enable this app role?
True(A) Click Overview in the left pane and then on your application in Managed application in local directory.
(A) Click on Set up single sign on.
(A) Under Attributes & Claims click Edit.
(A) Click on Add new claim.
(A) Assign the following values:
KeyValueName
rolesSource attribute
user.assignedroles(A) Select Users and Groups from the left pane and then Add user/group.
(A) Assign your test account to the
tenant-adminrole.(K) Open a new tab in your browser and login to the target Spark tenant. Access the Keycloak console from the User menu.
(K) Login to the Keycloak Admin Console using your admin credentials.
(K) Select Identity Providers from the left pane and then the identity provider you configured in the previous section.
(K) Select the Mappers tab and then Add mapper.
(K) Provide the following values.
NameValueName
tenant-adminSync mode override
forceMapper type
Advanced Claim to Group(K) Click Add Claims.
(K) Provide the following values:
KeyValuehttp://schemas.microsoft.com/ws/2008/06/identity/claims/roletenant-admin(K) Leave Regex Claim Values as Off (which is the default).
(K) Click Select Group, choose
tenant-admin, then click Select.(K) Click Save.
Sign in into Coherent Spark with your test account. Click on your initials and hover over the groups icon to confirm your membership in
tenant-admin.We highly recommend creating at least a few additional app groups relevant for Private tenants:
Group for
supervisor:pfuser accounts. In Spark,supervisor:pfmembers can manage permissions across all folders.Groups for "standard" user accounts, e.g.
user:teamA,user:teamB. These groups can be assigned to the users in your organization not responsible for tenant administration. Creating multiple roles for "standard" user accounts can be useful to separate access between teams.
Configure Entra ID groups to Spark user groups
It is recommended to use two separate browser tabs for the Azure and Keycloak portals to make it easier to apply the settings. In this guide, we will setup the automatic roles for the tenant-admin role.
(A) In the first tab sign in to Azure Portal.
(A) Search for and select Microsoft Entra ID.
(A) Select App registrations, then select the application you previously created and click Token Configuration.
(A) Click Add groups claim.
(A) Select the group types you want to include.
Note: If you have users who are members of more than
150groups, please select the option: Groups assigned to the application. This is recommended for large enterprises to avoid exceeding the limit on the number of groups a token can emit. Additionally, ensure that you add the necessary groups as members to the application you previously created.
(A) Expand the SAML section, select Group ID and click Save.
(A) On the left pane select Groups.
(A) Create or search for your Spark
tenant-admingroup.(A) Ensure your test account is a member of the group and copy the Object ID of the group.
(K) Open a new tab in your browser and login to the target Spark tenant. Access the Keycloak console from the User menu.
(K) Login to the Keycloak Admin Console using your admin credentials.
(K) Select Identity Providers from the left pane and then the identity provider you configured in the previous section.
(K) Select the Mappers tab and then Add mapper.
(K) Provide the following values.
NameValueName
tenant-adminSync mode override
forceMapper type
Advanced Claim to Group(K) Click Add Claims.
(K) Provide the following values:
KeyValuehttp://schemas.microsoft.com/ws/2008/06/identity/claims/groupsGroup object ID from Step 9
(K) Leave Regex Claim Values as Off (which is the default).
(K) Click Select Group, choose
tenant-admin, then click Select.(K) Click Save.
Sign in into Coherent Spark with your test account. Click on your initials and hover over the groups icon to confirm your membership in
tenant-admin.We highly recommend creating at least a few additional app groups relevant for Private tenants:
Group for
supervisor:pfuser accounts. In Spark,supervisor:pfmembers can manage permissions across all folders.Groups for "standard" user accounts, e.g.
user:teamA,user:teamB. These groups can be assigned to the users in your organization not responsible for tenant administration. Creating multiple roles for "standard" user accounts can be useful to separate access between teams.
Enable SAML token encryption eetween Microsoft Entra ID and Keycloak
The following steps configure:
Keycloak: to generate an RSA encryption keypair and accept encrypted SAML assertions.
Microsoft Entra ID: to encrypt SAML assertions using Keycloak’s certificate.
Configure Keycloak for SAML assertion decryption
Create an RSA Encryption Key
In Keycloak, open your realm (e.g., mytenant).
Go to Realm Settings → Keys (left panel).
Select Add provider.
Choose rsa-enc-generated from the list.
Fill in the following fields:
KeyValueName
Any descriptive name
Priority
100Enabled
OnActive
OnKey size
2048Algorithm
RSA-OAEPClick Save.
Export the public certificate
Go back to the Keys list tab.
Locate the newly created rsa-enc-generated key (Provider = Name).
Click Certificate.
Copy the entire certificate text and save it as a
.cerfile, e.g.keycloak-saml-encryption.cer.
Enable assertion encryption on the SAML Identity Provider
In the left navigation, go to Identity Providers.
Select your previously configured Microsoft Entra SAML provider.
Scroll down to the SAML Settings section.
Set Want Assertions Encrypted to On.
KeyValueWant Assertions Encrypted
OnEncryption Algorithm
RSA-OAEPClick Save.
Configure Microsoft Entra ID to encrypt SAML tokens
In the Microsoft Entra admin center, open your Enterprise Application (the SAML app pointing to Keycloak).
In the left menu, under Security, select Token encryption.
Click Import certificate and upload the
.cerfile you exported from Keycloak.After the certificate appears in the list, click the "three-dot menu" next to the certificate and select Activate Token Encryption Certificate.
Configure verification certificates
Enable Keycloak to sign SAML requests
Export the Keycloak Signing Certificate
In Keycloak, open your realm (e.g.,
mytenant).Go to Realm Settings → Keys → Key List.
Locate the key with:
KeyValueAlgorithm
RS256Type
RSAUse
SIGClick Certificate.
Copy the full certificate text and save it as a
.cerfile, e.g.keycloak-saml-sig.cer.
Enable signed AuthnRequests in Keycloak
Go to Identity Providers in the left navigation.
Select your Microsoft Entra SAML provider.
Scroll to the SAML Settings section.
Set the following:
KeyValueWant AuthnRequests Signed
OnSignature Algorithm
RSA_SHA256SAML Signature Key Name
KEY_IDWant Assertions Signed
OnClick Save.
Configure Microsoft Entra ID to verify the certificate
Upload the Keycloak Signing Certificate in Entra
In the Microsoft Entra admin center, open your Enterprise Application (the SAML app pointing to Keycloak).
Go to Single sign-on, scroll to SAML Certificates, and open Verification certificates (optional).
Ensure:
Require verification certificates is
Enabled.Allow requests signed with RSA-SHA1 is checked (optional fallback).
Upload the
.cerfile you exported from Keycloak earlier.Click Save.
Enable Privileged Identity Management (PIM)
See MS Entra ID Privileged Identity Management (PIM).
Create an enterprise application for Coherent Spark
See Microsoft Apps.
Last updated
