From the course: Microsoft Entra ID for .NET Developers

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Grant consent to call a custom API

Grant consent to call a custom API

- At this point, I have a web API project ready to go. I have the app registration and I have the code written that makes use of this app registration and exposes a web API at a certain URL. I also have an application written using this web app app registration. I want to now extend that application so it can call this web API. How do I do that? Well, the first thing we need to do is fix consents. Remember when I called Microsoft Graph, I had to grant consent. So under API permissions, I searched for Application.Read and I granted consent to that. So if I write just code and I don't grant consent, I won't be able to call the API. So I need to wire these things up in the intra ID portal first. How do I do that, simple. Just like I added Microsoft Graph, click on add permission and instead of picking one of these blocks that Microsoft has set up for us, go to APIs my organization uses and type in the client ID of your web API. Now be very careful as you type, if you have a space here or…

Contents