0
votes

I have an ASP.NET core web application with Angular as front end. I have a web API created in my application which I can invoke from angular app. I wanted to protect both my Web API and Angular client app using MSAL. I managed to get MASL working for my Angular app. I then added authentication for my Web API. Now if I call my API from Angular app, it returns 401 unauthorized response.

I assumed that if the Angular app is authenticated, I would be able to call my Web API as both are protected with same Azure AD application.

Please assist.

1

1 Answers

0
votes

Yes, both Web API and Angular App are secured with Azure AD. To secure ASP.NET Core Web API and Angular App using MSAL with Azure Active Directory (Azure AD) using the Microsoft Authentication Library for Angular (MSAL Angular) read more here. Could you please double-check that you added the permissions correctly?

MSAL for Angular

Configure an application to expose a web API

Call an ASP.NET web API that's protected by Microsoft identity platform