Azure Entra ID
This guide will walk you through the steps required to configure Azure Entra ID as a SAML identity provider in Keycloak.
Prerequisites
Section titled “Prerequisites”- Access to your Azure Entra ID Tenant, with at least Cloud Application Administrator Privileges.
- Existing Entra ID Groups that are designated for Administrators and Auditors of UDS Core Applications (see note below).
- VERY IMPORTANT Users configured in Entra are REQUIRED to have an email address defined, without this Keycloak will fail to create the user.
UDS Core comes with two preconfigured user groups in Keycloak:
AdminandAuditor. These groups are assigned roles to the various applications deployed by UDS Core, outlined here. Using Identity Provider Mappers in Keycloak, we can map your existing Administrator and Auditor groups in Azure Entra ID to theAdminandAuditorgroups in Keycloak. See User Groups for more details.
Creating Application Registrations in Azure Entra ID
Section titled “Creating Application Registrations in Azure Entra ID”In this section, we will configure Application Registrations for each Keycloak realm deployed with UDS Core - the default master realm and the uds realm. The two App Registrations should be nearly identical, with the main difference being their Redirect URI.
Create App Registration - Master Realm
Section titled “Create App Registration - Master Realm”- In Azure Entra ID, navigate to the “App registrations” page under “Manage”.
- Click “New registration”.
- Input a name for the application.
- Under “Supported Account Types”, select “Accounts in this organizational directory (
only - Single tenant)”. - Under “Redirect URI”, select “Web” from the drop down menu and then input the following as the URL:
https://keycloak.<admin_domain>/realms/master/broker/azure-saml/endpoint. - Click “Register” when done.

Once created, you will be directed to your application’s configuration page in Entra ID. Follow the steps below to configure the App Registration:
-
On the left-hand side, navigate to “Manage” > “Token configuration”. Here you will need to add the following as “Optional claims”:
Claim Token Type acctSAML emailSAML ipaddrID upnSAML
When adding these claims, a dialogue box will appear that says “Some of these claims (email, upn) require OpenID Connect scopes to be configured through the API permissions page or by checking the box below.”. Select the checkbox that says “Turn on the Microsoft Graph email, profile permission (required for claims to appear in token). Click “Add”.
- You will also need to add a “Groups claim” as follows:
- Select “All groups” under “Select group types to include in Access, ID, and SAML tokens.” Accept the default values for the rest.
- Click “Add” when done.

- Next, Navigate to “Expose an API” under “Manage”
- On the top of the page, you will see “Application ID URI”. Click “Add”.
- The window that appears should automatically populate with
api://<Application (Client ID)>. Note this value. You will need it for configuring the Azure SAML Identity Provider in Keycloak later. - Click “Save”.
Create App Registration - UDS Realm
Section titled “Create App Registration - UDS Realm”Repeat the steps above to create a new App Registration for the UDS Realm. Note the following caveats below:
- When you get to step 3, ensure that you provide the Application Registration a unique name.
- When asked to provide a “Redirect URI”, provide the following:
https://sso.<domain>/realms/uds/broker/azure-saml/endpoint - Continue with next steps.
Keycloak Azure Entra Identity Provider Setup
Section titled “Keycloak Azure Entra Identity Provider Setup”-
Log into Keycloak Admin UI
keycloak.< admin_domain >- The Keycloak admin username and password varies based on how UDS Core is deployed
- If deploying with the bundle override
INSECURE_ADMIN_PASSWORD_GENERATION- The username will be
adminand the password will be in a Kubernetes secret calledkeycloak-admin-password
- The username will be
- If not deploying with bundle override
- An admin user will need to be registered by using
zarf connect keycloak - This temporary admin user is recommended to be removed later
- An admin user will need to be registered by using
- If deploying with the bundle override
-
Both Master and UDS Realms should be created by deploying UDS Core
- Verify this in the Top Left dropdown
Master Realm
Section titled “Master Realm”-
Configure the Required Actions
- Select
Authenticationtab from left side nav bar under Configure - Select
Required actionstab from top nav bar - Now disable all required actions
- These required actions are configurations that every user registered to the Master realm will need to complete, even if they register via an Identity Provider like Entra. This can add unnecessary checks that a user will need to configure when they register. Since we are shifting all authorization to Azure Entra, these will be repetitive validations.
- Select
-
Configure User Groups and Realm Roles
- Select
Groupstab from left side nav bar under Manage - Select
Create Groupbutton in the middle of the page - Name that group
admin-groupand select theCreatebutton - Select the newly created
admin-group, this will open aGroup detailspage - Select
Role Mappingtab from top nav bar - Select
Assign rolebutton in the middle of the page - On the pop up page, Select the
Filter by clientsdropdown in the top left and selectFilter by realm roles - This should be a much smaller list, now toggle the
adminrole and clickAssignin the bottom left corner
- This creates a Master Realm specific group for admin users to be put into when they register. This group will be mapped from the Entra user into Keycloak. This group gives the admin users complete control, if the admin users should not have those controls then creating a different role with the reuiqred controls would be necessary and a group that is connected to that role.
- Select
-
Configure the SAML Identity Provider for Azure
-
Select
Identity Providerstab from left side nav bar under Manage -
Select
SAML v2.0option from middle of page underUser-defined- Should be on a new page called
Add SAML providernow - Change the
Aliasfield toazure-saml - Change the
Display namefield toAzure SSO - Get the
Service provider entity IDfrom the Entra portal:- Entra - App Registrations
- Select Application from list for master realm
- Copy the
Application ID URI and copy that theService provider entity ID` in the Keycloak Identity Provider creation
- Get the
SAML entity descriptorfrom the Entra portal:- Entra - App Registrataions
- Select Application from list for master realm
- Select the
Endpointstab from top nav bar - Copy the
Federation metadata documentendpoint over to theSAML entity descriptorin the Keycloak Identity Provider creation, make sure that it gets the green checkmark
- Select
Addbutton, should now see an Azure SSO page that has been auto populated - Toggle
Backchannel logouttoOnunderSAML Settings - Toggle
Trust EmailtoOnunderAdvanced settings - Change the
First login flow overrideunderAdvanced settingsto befirst broker login - Select
Save
- Should be on a new page called
-
Select
Mapperstab from top nav bar- Select
Add mapper, should now be onAdd Identity Provider Mapperpage- Change
Namefield toUsername Mapper - Change
Sync mode overridefield toForce - Change
Mapper typefield toAttribute Importer - Change
Attribute Namefield tohttp://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress - Change
User Attribute Namein the dropdown field tousername - Select
Saveand navigate back toProvider detailsvia the breadcrumbs at top of page
- Change
- Select the
Add mapper- Change
Namefield toFirst Name Mapper - Change
Sync mode overridefield toForce - Change
Mapper typefield toAttribute Importer - Change
Attribute Namefield tohttp://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname - Change
User Attribute Namein the dropdown field tofirstName - Select
Saveand navigate back toProvider detailsvia the breadcrumbs at top of page
- Change
- Select the
Add mapper- Change
Namefield toLast Name Mapper - Change
Sync mode overridefield toForce - Change
Mapper typefield toAttribute Importer - Change
Attribute Namefield tohttp://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname - Change
User Attribute Namein the dropdown field tolastName - Select
Saveand navigate back toProvider detailsvia the breadcrumbs at top of page
- Change
- Select the
Add mapper- Change
Namefield toEmail Mapper - Change
Sync mode overridefield toForce - Change
Mapper typefield toAttribute Importer - Change
Attribute Namefield tohttp://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress - Change
User Attribute Namein the dropdown field toemail - Select
Saveand navigate back toProvider detailsvia the breadcrumbs at top of page
- Change
- Select the
Add mapper- Change
Namefield toGroup Mapper - Change
Sync mode overridefield toForce - Change
Mapper typefield toAdvanced Attribute to Group - Select
Add Attributesfrom middle of page - Enter key
http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsand value is in the EntraManage Groups, Pick the admin group and copy the Group ID into the value field - Select
Select groupbutton - Select
admin-groupfrom the pop up window and clickSelect - Select
Saveand navigate back toProvider detailsvia the breadcrumbs at top of page
- Change
- This creates mappers for mapping users information between Entra and Keycloak. While not absolutely necessary there is many reasons why this is a good idea. Make sure the Entra group that is for admins is very restrictive and only users that should have control of keycloak are admitted.
- Select
-
-
Configure Authentication Flows and default Browser Flow
- Select
Authenticationfrom left side nav bar under Configure - Select
Create Flowfrom top nav bar, should be onCreate flowpage now- Change
Nametobrowser-idp-redirect - Select
Create, should be onbrowser-idp-redirectpage now, this is not in use yet - Select
Add an execution - In the search bar enter
redirectorand select theIdentity Provider Redirector, and clickAdd - Change the requirement dropdown to
REQUIRED - Select the gear settings icon
- Change
AliastoBrowser IDP - Change
Default Identity Providertoazure-saml
- Change
- Select the
Authenticationbreacrumb at the top of the page
- We have created an Identity Provider and we have disabled the use of username passwords for admin users. So we need to disable the final route for admin users to utilize those passwords.
- Select
-
OPTIONAL but recommended - Configure a Client for service account authentication
- Select
Clientsfrom left side nav bar under manage - Select
Create clientfrom top nav bar - Change
Client IDfield toservice-client - Change
Namefield toService Client - Change
Descriptionfield toService Account Enabled Client - Select
Nextbutton from bottom of page - Toggle
Client authenticationtoOn - Toggle
Standard flowtoOff - Toggle
Direct access grantstoOff - Toggle
Service account rolestoOn - Select
Nextbutton from bottom of page - Select
Savebutton from bottom of page - Should be on the
service-clientclient details page now - Select the
Service accounts rolestab from top nav bar - Select
Assign role - Switch the
Filter by clientsdropdown toFilter by realm roles - Select the
adminrole and clickAssignat bottom of pop up
- This step creates a Keycloak client that can only be used via service accounts. This means things like Terraform or otherwise. Instead of providing a users credentials to run terraform against keycloak, the client_id and client_secret could be used instead. The
client_idcan be found on the client details page and theclient_secretcan be found in theCredentialstab of the client. This is not necessary but can provide another avenue to manage day 2 ops for Keycloak.
- Select
-
Testing Changes
This requires that user be setup in Entra and have the correct group defined in Entra that maps to the Keycloak admin group created earlier
- We would recommend testing all of these changes at this point to verify functionality of Authentication flows
- Select the
Adminuser drop down from top right corner of screen - Select
sign out - Should be redirected to a Keycloak login screen where Username/Password is enabled and an
Azure SSOoption is present
- We will disable the Username/Password Authentication Flow after we’ve tested that everything is working otherwise if anything is misconfigured, you won’t be able to get back in and will have to start this process over again.
- Select the
Azure SSOoption - Should experience some redirects and land on Entra Login page
- Enter Entra Users information
- Should be redirected to the Admin UI again with full permissions
-
FINALLY
-
When configuration of Keycloak is complete and everything is working, do these final steps:
-
Disable Username Password Auth
- Select
Authenticationfrom left side nav bar under Configure - Find the newly created
browser-idp-redirectAuthentication Flow - Select the three dots at the far right of the row
- Select the
Bind flowoption - Select the
Browser flowfrom the dropdown and clickSave
- Since we are shifting authentication to Entra, we setup an Authentication flow that automatically redirects users to Entra when they need to login or register. This mitigates both confusion and misconfigurations.
- Select
-
Remove the admin user that was initial created
- Select
Userstab from left side nav bar under Manage - This next step will remove you from Keycloak if you’re still using the temp admin user
- Select the three dots from the far right of admin row
- Select
Delete
- This user is a requirement for keycloak to be accessed and configured the very first time. So by default this user is a super user and should be removed so that a user cannot assume the admin users creds.
- Select
-
UDS Realm
Section titled “UDS Realm”- Configure the SAML Identity Provider for Azure
-
Select
Identity Providerstab from left side nav bar under Manage -
Select
SAML v2.0option from middle of page underUser-defined- Should be on a new page called
Add SAML providernow - Change the
Aliasfield toazure-saml - Change the
Display namefield toAzure SSO - Get the
Service provider entity IDfrom the Entra portal:- Entra - App Registrations
- Select Application from list for master realm
- Copy the
Application ID URIand copy that theService provider entity IDin the Keycloak Identity Provider creation
- Get the
SAML entity descriptorfrom the Entra portal:- Entra - App Registrataions
- Select Application from list for master realm
- Select the
Endpointstab from top nav bar - Copy the
Federation metadata documentendpoint over to theSAML entity descriptorin the Keycloak Identity Provider creation, make sure that it gets the green checkmark
- Select
Addbutton, should now see an Azure SSO page that has been auto populated - Toggle
Backchannel logouttoOnunderSAML Settings - Toggle
Trust EmailtoOnunderAdvanced settings - Change the
First login flow overrideunderAdvanced settingsto befirst broker login - Select
Save
- Should be on a new page called
-
Select
Mapperstab from top nav bar- Select
Add mapper, should now be onAdd Identity Provider Mapperpage- Change
Namefield toUsername Mapper - Change
Sync mode overridefield toForce - Change
Mapper typefield toAttribute Importer - Change
Attribute Namefield tohttp://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress - Change
User Attribute Namein the dropdown field tousername - Select
Saveand navigate back toProvider detailsvia the breadcrumbs at top of page
- Change
- Select the
Add mapper- Change
Namefield toFirst Name Mapper - Change
Sync mode overridefield toForce - Change
Mapper typefield toAttribute Importer - Change
Attribute Namefield tohttp://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname - Change
User Attribute Namein the dropdown field tofirstName - Select
Saveand navigate back toProvider detailsvia the breadcrumbs at top of page
- Change
- Select the
Add mapper- Change
Namefield toLast Name Mapper - Change
Sync mode overridefield toForce - Change
Mapper typefield toAttribute Importer - Change
Attribute Namefield tohttp://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname - Change
User Attribute Namein the dropdown field tolastName - Select
Saveand navigate back toProvider detailsvia the breadcrumbs at top of page
- Change
- Select the
Add mapper- Change
Namefield toEmail Mapper - Change
Sync mode overridefield toForce - Change
Mapper typefield toAttribute Importer - Change
Attribute Namefield tohttp://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress - Change
User Attribute Namein the dropdown field toemail - Select
Saveand navigate back toProvider detailsvia the breadcrumbs at top of page
- Change
- Select the
Add mapper- Change
Namefield toAdmin Group Mapper - Change
Sync mode overridefield toForce - Change
Mapper typefield toAdvanced Attribute to Group - Select
Add Attributesfrom middle of page - Enter key
http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsand value is in the EntraManage Groups, Pick the admin group and copy the Group ID into the value field - Select
Select groupbutton - Select
/UDS Core/Adminfrom the pop up window and clickSelect - Select
Saveand navigate back toProvider detailsvia the breadcrumbs at top of page
- Change
- Select the
Add mapper- Change
Namefield toAuditor Group Mapper - Change
Sync mode overridefield toForce - Change
Mapper typefield toAdvanced Attribute to Group - Select
Add Attributesfrom middle of page - Enter key
http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsand value is in the EntraManage Groups, Pick the auditor group and copy the Group ID into the value field - Select
Select groupbutton - Select
/UDS Core/Auditorfrom the pop up window and clickSelect - Select
Saveand navigate back toProvider detailsvia the breadcrumbs at top of page
- Change
- Select
-
Testing
Section titled “Testing”- Navigate to
sso.< domain > - Select the
Azure SSO - Go through Entra Login
- Should be able to access Keycloak Account UI