Loading...

Customize your authentication flows with custom claims providers!

Customize your authentication flows with custom claims providers!

Howdy folks, 

 

I’m super excited to announce the public preview of custom claims providers for Azure Active Directory (Azure AD), now part of Microsoft Entra.  

 

A custom claims provider lets you call an API and map custom claims into the token during the authentication flow. The API call is made after the user has completed all their authentication challenges, and a token is about to be issued to the app.  

We heard from many of you that you need to return additional claims into the tokens sent to your apps so that they could function as intended. And these claims were being sourced from external systems, for a few reasons: 

 

  • You needed to keep sensitive attributes on premises and use Active Directory Federation Services, or other federation services to pass through claims to Azure AD. 
  • Regulatory requirements prevented you from being able to synchronize these attributes to Azure AD. 
  • You have complex RBAC models which are stored in external databases. 
  • You don’t own the app or cannot modify the app to fetch these attributes post authentication.

Now, with custom claims providers, you can source claims from external systems and issue them directly into the token. It allows interfacing with any data store, LDAP, SQL or anything else. A custom claims provider can be setup for your Open ID and SAML apps, and it works in scenarios to authenticate employees, and external identities. 

 
Let’s show you how you can set this up for Contoso’s HR app. In this scenario, Contoso are looking to decouple their HR app from Active Directory Federation Services, and authenticate directly with Azure AD. The HR app expects the user’s employee number to be returned in the token, which is stored in an on-premises Active Directory.  

 

Contoso can configure a custom claims provider to fetch this data and insert it into the token during authentication. Let’s begin setting it up for Contoso’s Azure AD.  
 
In the Enterprise applications menu, the Contoso Admin selects Custom authentication extensions, and then selects Create a custom extension. 

 

 

SHDriggers_1-1678974578200.png

 

 

They then select TokenIssuanceEvent and select Next. 

 

 

SHDriggers_2-1678974578204.png

 

 

 

The admin enters a Name, the API endpoint, and Description for Contoso’s API, and selects Next. The API endpoint would communicate with Active Directory using an LDAP search to fetch the user’s employee number. 

 

 

SHDriggers_3-1678974578207.png

 

 

Next, the Contoso admin can configure how the custom extension will authenticate to their API. They will select Create new app registration, provide a Name, and select Next. We will use client credentials to authenticate to Contoso’s API.  Since Contoso hosts their API using an Azure Functions app, this app registration will be used to protect it automatically. 

 

 

SHDriggers_4-1678974578213.png

 

 

Then, they configure the attribute name returned by the API to the custom extension. Contoso’s API will return the attribute employeeName. The admin enters employeeName under Claim name, and selects Next. 

 

 

SHDriggers_5-1678974578216.png

 

 

Now let’s map in the claim for the HR App Registration using the custom claims provider. The Contoso admin navigates to the Enterprise Applications menu, selects their App, selects Single sign-on, and then selects Edit under Attributes and Claims. 

 

 

SHDriggers_6-1678974578220.png

 

 

The Contoso admin then needs to create a claims mapping to source the employee number from the custom extension by configuring a custom claims provider. 

 

They expand the Advanced menu, and select Configure 

 

 

SHDriggers_7-1678974578223.png

 

 

The admin selects Custom claims provider and selects the custom extension that was created earlier, then selects Save. 

 

 

SHDriggers_8-1678974578226.png

 

Finally, the admin selects Add new claim and enters a Name for the claim to be issued into the token. They will then select Attributes under Source, and select the Source Attribute, which will be in the format: customClaimsProvider.attributeName. Then select Save. 

 

 

SHDriggers_9-1678974578228.png

 

 

Now that’s all done, when a user completes their sign in into the Contoso HR app, the custom extension will be triggered, and the custom claims provider will use the custom extension to add the employee number into the token. 

 

Here’s a diagram showing the flow. 

 

 

SHDriggers_10-1678974578230.png

 

 

There is a more in-depth video tutorial you can find below: https://youtu.be/BYOMshjlwbc

 

 

Custom claims providers is just the first use of a custom extension. We’ll continue to release additional custom extension events, so you can customize your authentication flows even more. 


You can read more about custom extensions here and about custom claims providers here. Get started with setting up a custom claims provider here. 

 

As always, we'd love to hear your feedback, thoughts, and suggestions! Feel free to share with us on the Azure AD forum or leave comments below. We look forward to hearing from you. 

 

Best regards, 
Alex Simons (@Alex_A_Simons) 
Corporate VP of Program Management 
Microsoft Identity Division 

 

 

 

Learn more about Microsoft identity:  

Published on:

Learn more
Azure Active Directory Identity Blog articles
Azure Active Directory Identity Blog articles

Azure Active Directory Identity Blog articles

Share post:

Related posts

How to Build Environment-Aware Flows by Fetching CRM Metadata Dynamically in Power Automate

Stop relying on OData workarounds and use a professional API-based pattern instead. When building flows in Power Automate, you often need envi...

12 hours ago

Action ‘Update_a_record’ failed: An error has occurred. No resources were found when selecting for update – Fixing Cross-Company Update Issues in Finance & Operations Using Dataverse Virtual Entities (Power Automate)

Recently, while trying to update the Projects table in Finance & Operations using the Fin & Ops Apps actions in Power Automate, we ran...

2 days ago

Power Automate Forward A Meeting Invite In Outlook

A Power Automate flow can forward a meeting invite to a new attendee in Outlook. ... The post Power Automate Forward A Meeting Invite In Outlo...

2 days ago

Power Automate Generative Actions

Power Automate Generative Actions Build Intelligent Automations with Natural Language and AI 📅 Released: Preview (2024-2025) 🎯 Status: Publi...

7 days ago

Create Excel File in OneDrive Using Power Automate and Insert Records Dynamically from Dataverse

Exporting Dataverse records into Excel is a common requirement in Dynamics 365 and Power Platform projects—whether for reporting, backup, or d...

7 days ago

Fixing the “Only 1 of 2 keys provided for lookup, provide keys for dataAreaId, ProjectID / Not found” Error in Power Automate (Fin & Ops Apps)

Recently, while working with the Projects table from a Finance & Operations (F&O) environment, we ran into an error while using the Ge...

9 days ago

Rules of Engagement: How Plugins, Workflows, and Power Automate Coexist in the Execution Pipeline

Understanding how the three automation engines interact—Plugins, Classic Workflows, and Power Automate—is essential for designing predictable,...

9 days ago

Power Automate: Fixing the ‘ChildFlowNeverPublished’ Error

While trying to enable one of the cloud flows from a managed solution I had installed, I encountered the following error:  “{“erro...

13 days ago

Power Automate – Information regarding the end of support for Document Automation Toolkit

On November 15, 2025, the Document Automation Toolkitfeature in Power Automate reached of support. How does this affect me? Makers will no lon...

13 days ago
Stay up to date with latest Microsoft Dynamics 365 and Power Platform news!
* Yes, I agree to the privacy policy