Authentication Flow for API Management with Azure Entra ID and API Key Integration

Alireza Mansoori 0 Reputation points
2025-02-14T09:57:48.2933333+00:00

I need to understand how authentication for API Management works. I have an HRM Flex API, described in Swagger, which requires an API key for authentication. However, the client application and users must authenticate using Azure Entra ID.

The attached diagram illustrates the architecture.

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
2,303 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
23,337 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Alireza Mansoori 0 Reputation points
    2025-02-14T09:59:05.92+00:00
    0 comments No comments

  2. Khadeer Ali 3,670 Reputation points Microsoft Vendor
    2025-02-14T14:37:29.4666667+00:00

    @Alireza Mansoori ,

    Thanks for reaching out. Here is a generalized approach to integrate Azure Entra ID for authentication in your API Management setup while also requiring an API key for the HRM Flex API:

    First, you'll need to register your application in Azure Entra ID. This application will be used to authenticate users and acquire tokens. Next, in Azure API Management, you'll set up policies to validate both the API key and the OAuth 2.0 token from Azure Entra ID. This involves using the validate-jwt policy to check the validity of the OAuth token presented in API requests and ensuring that the API key is also validated in the request.

    The client application will authenticate users via Azure Entra ID, obtaining an access token that must be included in the API requests along with the API key. When the API request is received, API Management will validate both the API key and the OAuth token before allowing access to the backend API.

    This approach ensures that both the API key and Azure Entra ID authentication mechanisms are enforced for secure access to your API. If you have any further questions or need additional assistance, feel free to ask!

    Please check the below references:

    Hope this helps. Do let us know if you have any further queries.


    If this answers your query, do click Accept Answer and Yes for "Was this answer helpful." And if you have any further questions, let us know.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.