question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to get MsalInterceptor's error

See original GitHub issue

Core Library

MSAL.js v2 (@azure/msal-browser)

Core Library Version

2.26.0

Wrapper Library

MSAL Angular (@azure/msal-angular)

Wrapper Library Version

2.3.2

Public or Confidential Client?

Public

Description

I want handle the MsalInterceptor error but I just got error log. I have requested an api which is not authorized by the admin. He seems to keep looping, requesting a token, making an error, logging in again. image image I want to deal with this error how to do? Do I need to write my own Interceptor? I listened to all events and it doesn’t seem to be an error event. image.

MSAL Configuration

No response

Relevant Code Snippets

this.broadcastService.msalSubject$.subscribe((result: EventMessage) => {
      console.error(result);
    });

Identity Provider

No response

Source

External (Customer)

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
laduducommented, Aug 19, 2022

@ladudu If you are wanting to show the error message after acquireTokenSilent fails in the MsalInterceptor, we recommend you use a custom interceptor, as the current MsalInterceptor will handle it interactively without throwing the error.

Thank you for your help.I would write myself interceptor. have a great day!

0reactions
jo-arroyocommented, Aug 19, 2022

Thank you. Closing this issue as customer question answered.

Read more comments on GitHub >

github_iconTop Results From Across the Web

MsalInterceptor not acquiring tokens when endpoint contains ...
MsalInterceptor does not seem to acquire tokens for such endpoints (e.g. ... 401 core.js:5980 ERROR HttpErrorResponse {headers: HttpHeaders, ...
Read more >
Handle errors and exceptions in MSAL.js - Microsoft Entra
Learn how to handle errors and exceptions, Conditional Access claims challenges, and retries in MSAL.js applications.
Read more >
Azure AD for Angular + ASP.net web api - Stack Overflow
header by MSAL Interceptor. all working good so far. When I run Post call to same API, I get unauthorized 401 error for...
Read more >
@azure/msal-angular - GitHub Pages
MsalInterceptor will obtain tokens and add them to all your Http requests in API calls based on the protectedResourceMap . @NgModule({ imports: [...
Read more >
How to use MSAL Angular 8 for authenticating Users - Medium
forRoot we will get the error “Cannot find the MsalModule”; ... import { MsalModule, MsalInterceptor } from '@azure/msal-angular';.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found