Microsoft Entra ID (SAML v2.0)
Prerequisites
Implement single sign-on (SSO) - Baseline
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 sign in to the target Spark tenant. Access the Keycloak console from the User menu.
(K) Select Identity Providers from the left pane.
(K) Expand the Add provider dropdown and choose SAML v2.0.
(K) Enter 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 sign-in 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, select New application.
(A) Select 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) Select Create.
(A) On the Overview page, in the Getting Started area, select 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, select Edit.
(A) Under the Basic SAML configuration, configure the following settings:
In Identifier (Entity ID), select 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}.Select 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 select 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.
In the Manage section in the left pane, ensure that Assignment required? is set to Yes.
In Users and groups in the left pane, select Add user/group to add the users and groups that will be allowed to use Spark.
If you are a Global Administrator in Microsoft Entra, the user assignment requirement does not apply. Global Administrators can bypass Enterprise Application assignment restrictions.
(K) Return to Keycloak. Paste the App Federation Metadata Url into the SAML entity descriptor field.
(K) Select Add.
(K) In NameID policy format, select Email.
(K) Select Save.
(K) Select the Mappers tab and then select 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 set up, scroll down to Signature and Encryption settings.
(K) Enable the option Validate Signature.
(K) Enable the option Metadata Descriptor URL.
Navigate to your Spark tenant and sign in using the newly created provider. The Keycloak sign-in page shows a button with the display name you defined earlier.
Set up 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 set up 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 select App roles.
(A) Select Create app role.
(A) Provide the following values and then select 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) Select Overview in the left pane and then on your application in Managed application in local directory.
(A) Select on Set up single sign on.
(A) Under Attributes & Claims select Edit.
(A) Select 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 sign in to the target Spark tenant. Access the Keycloak console from the User menu.
(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 select Add mapper.
(K) Provide the following values.
NameValueName
tenant-adminSync mode override
forceMapper type
Advanced Attribute to Group(K) Select 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) Select Select Group, choose
tenant-admin, then select Select.(K) Select Save.
Sign in to Coherent Spark with your test account. Select 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.
Map 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 set up 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 select Token Configuration.
(A) Select 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 select 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 sign in to the target Spark tenant. Access the Keycloak console from the User menu.
(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 Attribute to Group(K) Select 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) Select Select Group, choose
tenant-admin, then select Select.(K) Select Save.
Sign in into Coherent Spark with your test account. Select 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 assertion encryption - Advanced
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, for example
mytenant.Select 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-OAEPSelect Save.
Export the public certificate
Go back to the Keys list tab.
Locate the newly created rsa-enc-generated key (Provider = Name).
Select Certificate.
Copy the entire certificate text and save it as a
.cerfile, for examplekeycloak-saml-encryption.cer.
Enable assertion encryption on the SAML Identity Provider
In the left navigation, select Identity Providers.
Select your previously configured Microsoft Entra SAML provider.
Scroll down to the SAML Settings section.
Apply the following settings:
KeyValueWant Assertions Encrypted
OnEncryption Algorithm
RSA-OAEPSelect 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.
Select Import certificate and upload the
.cerfile you exported from Keycloak.After the certificate appears in the list, select the ellipsis menu next to the certificate and select Activate Token Encryption Certificate.
Enforce SAML request signing and certificate validation - Advanced
Enable Keycloak to sign SAML requests
Export the Keycloak Signing Certificate
In Keycloak, open your realm (e.g.,
mytenant).Select Realm Settings → Keys → Key List.
Locate the key with:
KeyValueAlgorithm
RS256Type
RSAUse
SIGSelect 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 pane.
Select your Microsoft Entra SAML provider.
Scroll to the SAML Settings section.
Apply the following settings:
KeyValueWant AuthnRequests Signed
OnSignature Algorithm
RSA_SHA256SAML Signature Key Name
KEY_IDWant Assertions Signed
OnSelect 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).
Check:
Require verification certificates is
Enabled.Allow requests signed with RSA-SHA1 is checked (optional fallback).
Upload the
.cerfile you exported from Keycloak earlier.Select Save.
Enable privileged identity management (PIM)
See Microsoft Entra ID privileged identity management (PIM).
Create an enterprise application for Coherent Spark
See Microsoft Apps.
Last updated
