angular - 如果有任何错误,我正在尝试重新验证
问题描述
我在“MSAL”中尝试“acquiresilenttoken”时遇到错误,但我无法执行“handleRedirectCallback”。我尝试添加一个调试器,但它永远不会进入“handleRedirectCallback”,这可能是什么原因。下面是我正在使用的代码。
if (err ) {
//this.authService.logout();
debugger
this.authService.handleRedirectCallback((err:AuthError) => {
debugger
if (err) {
console.error('Redirect Error: ', err.errorMessage);
return;
}
debugger
this.authService.loginRedirect();
console.log('Redirect Success: ');
});
this.broadcastService.broadcast('msal:notAuthorized', err.message);
}
我的 MSAL 配置:
"auth": {
"clientId": "xxx",
"authority": "https://login.microsoftonline.com/xxx",
"validateAuthority":"true",
"postLogoutRedirectUri": "http://localhost:44399/",
"navigateToLoginRequestUrl": true
},
"system":{
"loadFrameTimeout":10000
},
"cache": {
"cacheLocation": "localStorage"
}
解决方案
推荐阅读
- mysql - 使用while循环根据条件对多行进行分组
- python - 如何在 Matplotlib 中设置颜色范围?
- rust - 如何在编译时确保类型将序列化为 JSON 数组?
- php - 如何在 Drupal 7 中将表单添加为菜单项?
- r - 如何在拥挤的 tmap 图例中修复垂直空间 [R]
- python - 在 Python 中创建和排序二维列表
- python - 如何将函数应用于需要 Pandas 中的行索引的数据框?
- objective-c - 随机生成器的随机性稍差
- graphql - 有没有办法在 graphQL 中对查询进行分组?
- python - 带有类对象列表的 psycopg2 execute_values