Loading...

Introducing a better way to integrate Azure AD with API Management

Introducing a better way to integrate Azure AD with API Management
Since, well, the beginning of Azure API Management, you've been able to validate that the Json Web Token (JWT) coming into your Azure API Management service is valid before passing it onto the backend service. The validate-jwt policy is one of the most used policies within Azure API Management, will happily ensure your client applications are using the right client IDs, and have the right audiences and claims. Meanwhile, Azure Active Directory (AAD) is a mainstay of enterprise APIs, providing authentication and authorization controls for a wide variety of APIs from M365 APIs to custom-built APIs.  It's generally the center piece of your enterprise security infrastructure.

 

Wouldn't it be wonderful if they worked better together.
 

Introducing validate-azure-ad-token policy

This week we introduced a new policy for working with AAD in Azure API Management - the validate-azure-ad-token policy. It's a direct replacement for validate-jwt that you can use when you are targeting AAD.

 

Here is the general form of the policy:
<validate-azure-ad-token tenant-id="{{aad-tenant}}"> <client-application-ids> <application-id>{{aad-android-client-id}}</application-id> <application-id>{{add-ios-client-id}}</application-id> <application-id>{{aad-web-client-id}}</application-id> </client-application-ids> <audiences> <audience>@(context.Request.OriginalUrl.Host)</audience> </audiences> <required-claims> <claim name="ctry" match="any"> <value>US</value> </claim> </required-claims> </validate-azure-ad-token>
 
This version ensures that the audience is the API Management host and that the optional claim ctry (the country) is provided and has a specific value. This is actually a more complex example than is necessary.  You can get minimal validation by just specifying the `tenant-id` and the client application-id values you expect:
<validate-azure-ad-token tenant-id="{{aad-tenant}}"> <client-application-ids> <application-id>{{aad-client-id}}</application-id> </client-application-ids> </validate-azure-ad-token>

 

More information about the specifics of the policy can be found in the documentation.

 

Since we know that Azure API Management works wonderfully with AAD, it makes sense that we make it easier to configure and easier to take advantage of value-added services provided by the AAD service. Features like continuous access evaluation improve your security posture by removing the lag between when a token is issued and when it can be revoked. This allows you to issue tokens for longer periods without a loss in security which, in turn, improves the performance of the client application. You can expect to see these features being added to our new validate-azure-ad-token policy in the future.

 

We're really excited by this new policy because it provides an anchor for AAD specific functionality in the future.  It's easier to configure and sets you up for adopting future security enhancements at the gateway.  This will allow your API service to adopt the security enhancements provided by AAD without any code changes.

 

The validate-azure-ad-token policy is recommended for protecting your API with Azure Active Directory identities and Azure API Management.

Published on:

Learn more
Azure Developer Community Blog articles
Azure Developer Community Blog articles

Azure Developer Community Blog articles

Share post:

Related posts

This Month in Azure Static Web Apps | 09/2024

    We are back with another edition of the Azure Static Web Apps Community! :party_popper:   September was yet another month ...

1 year ago

GitHub Copilot for Azure: 6 Must-Try Features

As developers, we are constantly seeking tools that streamline our workflows and boost productivity. … Enter GitHub Copilot for Azure, now in ...

1 year ago

Responsible AI Mitigation Layers

Generative AI is increasingly being used in various kinds of systems to augment humans and infuse intelligent behavior into existing and new a...

1 year ago

Streamline Your Azure Workflow: Introducing GitHub Copilot for Azure in VS Code

I'm excited to announce the public preview of GitHub Copilot for Azure - a new addition to your toolkit that seamlessly integrates with G...

1 year ago

Build Intelligent Apps Code-First with Prompty and Azure AI

      Building Generative AI applications can feel daunting for traditional app developers. What does the end-to-end applicati...

1 year ago

Certificación AI-900 (Fundamentos de IA) con Chicas en IA

La inteligencia artificial ha llegado para quedarse, ¡y más aún con la revolucionaria IA generativa! Para ayudar a los profesionales a especia...

1 year ago

Get certified with Learn Live GitHub series!

GitHub Universe is coming, and Microsoft and GitHub are partnering to offer a new special Learn Live series in Brazilian Portuguese, English a...

1 year ago

Certifícate con Learn Live GitHub en Español

Microsoft y GitHub se han unido para ofrecer una nueva serie especial de Learn Live en inglés y español: GitHub 2024. Del 10 al 24 de Octubre,...

1 year ago

Evaluating generative AI: Best practices for developers

As a developer working with generative AI, you've likely marveled at the impressive outputs your models can produce. But how do you ensure the...

1 year ago

Introducing Azure Product Retirement Livestreams

The Azure Retirements team, in collaboration with key partner groups, is excited t...

1 year ago

Newsletter

Get the latest Dynamics 365 and Power Platform content in your inbox

A curated digest of community blogs, product news, videos, and podcasts — delivered without the noise.

Weekly updates Unsubscribe anytime Fresh community picks
We use your email only for the newsletter and you can unsubscribe at any time.
By subscribing, you agree to the privacy policy.