Authentication Flow for API Management with Azure Entra ID and API Key Integration
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.
2 answers
Sort by: Most helpful
-
-
Khadeer Ali 3,670 Reputation points Microsoft Vendor
2025-02-14T14:37:29.4666667+00:00 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:
- Protect an API in Azure API Management using OAuth 2.0 authorization with Microsoft Entra ID
- Authentication and authorization to APIs in Azure API Management
- Microsoft Entra identity configuration for Azure API for FHIR
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.