the MSAL for Angular library is in use with the Azure AD B2C custom policy. In some specific cases, for example when opening browser with restored session and logging in, the application stops loading at the auth
controller action.
The exact steps to reproduce the issue are:
- Login to the application,
- Logout,
- Close the browser,
- Open the browser with the previous session restored,
- Login with a different user credentials.
The application stops loading with a blank screen at the auth
action. It doesn't proceed to the default page.
The routing is configured correctly:
const routes: Routes = [
{
// Needed for handling redirect after login
path: 'auth',
component: MsalRedirectComponent
},
]
@NgModule({
imports: [RouterModule.forRoot(routes, {
.....
})],
exports: [RouterModule]
})
The MsalRedirectComponent
is correctly bootstrapped and configured according to the documentation
There is no error in the logs. I have set the logging level verbose
, but there is no information about what went wrong.
app.module.ts
has the MsalRedirectComponent
bootstrapped:
...
@NgModule({
declarations: [
...
],
imports: [
...
],
bootstrap: [
AppComponent,
MsalRedirectComponent
],
providers: [
...
]
})
export class AppModule { }
the index.html
also has the needed directive:
<body class="mat-typography">
<app-root></app-root>
<app-redirect></app-redirect>
</body>
Versions:
- Angular 15.1.3
- @azure/msal-angular 2.5.3
- azure/msal-browser 2.33.0
- msal 1.4.17