在我的app.module.ts中,我有这个msal-angular的配置:
imports: [
BrowserModule.withServerTransition({ appId: 'ng-cli-universal' }),
HttpClientModule,
FormsModule,
RouterModule.forRoot([
{ path: '', component: HomeComponent, pathMatch: 'full' },
{ path: 'ms-profile', component: MsProfileComponent, canActivate: [ MsalGuard ] }
]),
RouterModule,
MsalModule.forRoot({
auth: {
clientId: '7be72f7e-2433-4ef8-b1c7-9b1c91514659',
authority: 'https://login.microsoftonline.com//d566b150-219d-4312-ba59-3dca2f84a2ac',
validateAuthority: true,
redirectUri: 'http://localhost:4200/',
postLogoutRedirectUri: 'http://localhost:4200/',
navigateToLoginRequestUrl: true
}
}
)
]通常(根据文档),我应该得到一个重定向到aad (Azure Active Directory)的登录页面,但我总是得到一个弹出窗口。在这种情况下,我想通过重定向进行身份验证。
发布于 2020-04-01 22:02:10
显然,这不是配置问题,而是我登录用户的方式:
login() {
this.authService.loginRedirect();
// const isIE = window.navigator.userAgent.indexOf('MSIE ') > -1 || window.navigator.userAgent.indexOf('Trident/') > -1;
// if (isIE) {
// this.authService.loginRedirect();
// } else {
// this.authService.loginPopup();
// }
}因为在我的例子中isIE是假的,所以它做了弹出登录。
https://stackoverflow.com/questions/60972440
复制相似问题