Implement Azure ad authorization for api

Greg Coggin 0 Reputation points
2023-04-15T00:21:15.8566667+00:00

I just started work for a new company and I've been tasked with trying to figure out how to use Azure AD authentication to protect certain API functions. I've read a ton of documents & been through a whole bunch of tutorials on how to set everything up in the portal and then apply everything and I just can't get it to work with our application that already exists. I'm obviously missing something. If someone can point me to a very simple step by step explanation of each mechanism that has to be set up in order to do this I'd greatly appreciate it.

Microsoft Security | Microsoft Entra | Microsoft Entra ID
{count} votes

1 answer

Sort by: Most helpful
  1. Boris Von Dahle 3,221 Reputation points
    2023-04-15T01:20:45.44+00:00

    Hello,

    High-level steps to secure your API using Azure AD:

    1. Register an application in Azure AD for your API.
    2. Configure your API to use the Azure AD application for authentication and authorization.
    3. Register a client application in Azure AD (if you're building a separate app that will consume your API).
    4. Obtain an access token from Azure AD for your client application.
    5. Use the access token to call your API. For a more detailed, step-by-step guide, you can follow the official Microsoft documentation below:
    6. Register an application with the Microsoft identity platform
    7. Protect your web API with the Microsoft identity platform
    8. Quickstart: Configure your application to expose a web API
    9. Call a web API from a web app using Azure AD and OpenID Connect The specific steps may vary depending on the programming language and framework you're using for your API and client application. If you're using .NET, you can follow this tutorial to secure your API using Azure AD:
    0 comments No comments

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.