0

I am using B2c with an Angular application hosted in Azure Storage Static Website and an Angular functions application.

Using the code below I can see that I appear to be logged in. Where isLoggedIn = true.

 await this.msalInstance.handleRedirectPromise();
    let isLoggedIn = this.authService.instance.getAllAccounts().length > 0;

However, as soon as I make a web call I get redirected to the redirection URL of my app (the login screen is not shown).

I was hoping someone might have an idea of how I could troubleshoot this, either by exposing more logs or different configurations I might look at that could cause this behavior.

Brian
  • 4,921
  • 3
  • 20
  • 29
Xander
  • 9,069
  • 14
  • 70
  • 129
  • Does this help at all? https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-angular/docs/v2-docs/redirects.md. It's been so long since I used this, and don't have access to the code, but I believe we had an interceptor set up a few years ago, as ugly as it was, to bypass this issue. – Brian Jun 03 '22 at 00:41
  • Show code snippet of calling API. – Jas Suri - MSFT Jun 03 '22 at 07:15
  • Is the webapi that you're calling also protected by AAD? Have you setup protected routes so the MSAL intercepter can it job? – Charlie V Jun 03 '22 at 07:32

0 Answers0