Hello @Admin (KK) It seems like you want to add custom claims to your JWT tokens in your web app. Here’s a high-level overview of how you can achieve this:
- Create an Azure Function app: This function API will be the source of extra claims for your token.
- Register a custom authentication extension: This extension will be associated with your Microsoft identity application registration.
- Configure an OpenID Connect app to receive enriched tokens: This app will receive the tokens that have been enriched with the custom claims.
- Develop a REST API for the token issuance start event: This API will interface with downstream services (like databases or other REST APIs) that contain the attributes you’d like to add to the token configuration.
- Configure a claims mapping policy: This policy modifies the claims emitted in tokens issued for specific applications.
Remember, the attributes returned by your REST API aren’t automatically added into a token. An application’s claims mapping policy must be configured for any attribute to be included in the token.
For more detailed steps and code examples, you might want to check out the Microsoft Learn articles on Getting started with custom claims providers and Custom claims provider reference. These guides provide comprehensive instructions and examples to help you implement custom claims in your app. Please note that this is a high-level overview, and the exact implementation might vary based on your specific use case and the technologies you’re using. I hope this answers your question, and if so, please tag this as answered.