MSAL Angular cached login doesn't InteractionStatus progress beyond Startup

Discussão em 'Angular' iniciado por Zulukas, Maio 5, 2025.

  1. Zulukas

    Zulukas Guest

    I'm having issues with the @azure/msal-angular v4 library. Currently I believe I have the MsalService and MsalBroadcastingService correctly configured and injected into my AppComponent.

    The specific issue I am seeing is that when I have a cached login (I probably have terminology wrong, basically I can visit the site after logging in without being prompted to login), the call for this.msalBroadcastingService.inProgress$ never emits a status beyond InteractionStatus.Startup.

    However, if I go into an incognito browser and visit the site, I will be redirected to the login page, I sign in, get redirected back, and the site works correctly. With some debug statements I can observe that the observable, inProgress$, emits "InteractionStatus.None" indicating it has completed and I am signed on.

    When I refresh the page though, I see it emit "InteractionStatus.Startup", and there it stops.

    Here is the OnInit code in my AppComponent:

    private initMsal(): void {
    this.msalBroadcastService.inProgress$.pipe(
    tap(x => console.log(`tap: ${x}`)), // my debug statement to track status
    filter(status => status === InteractionStatus.None)
    ).subscribe(() => {
    console.log('subscribe callback'); // debug statement to indicate we've made it to None

    this.checkAndSetActiveAccount(); // our code post login
    this.setupMenu();
    });
    }


    Can anyone provide any starting points as to how I can debug or resolve this issue?

    Continue reading...

Compartilhe esta Página