
在我的应用程序中,我得到了“令牌已过期”的问题,请帮助我如何订阅令牌过期方法和注销应用程序或否则增加过期时间。请找到下面的错误截图供您参考。提前谢谢你。
发布于 2021-03-28 15:40:06
您需要在令牌过期之前刷新令牌。查看文档here (if you're using Code Flow)或here (if you're using implicit flow)
在您的app.component.ts文件中,您还可以在配置oAuthService之后(在调用this.oauthService.loadDiscoveryDocumentAndTryLogin();之后)尝试订阅"token_expires“事件
this
.oauthService
.events
.filter(e => e.type == 'token_expires')
.subscribe(e => {
this.oauthService.silentRefresh();
});https://stackoverflow.com/questions/66021976
复制相似问题