iframe - 用户的空闲状态(使用 ngIdle)正在中断,同时使用角度 5 中的 Iframe 从身份服务器静默刷新访问令牌
问题描述
我的应用程序如何工作。
我每 10 分钟使用Iframe从身份服务器刷新一次令牌。我在我的应用程序中使用ngIdle来跟踪用户的空闲情况。
每 10 分钟调用一次刷新
setInterval(() =>{
this.refreshToken();
},100000);
使用 iframe 调用 URL
refreshToken(){
let iframe =document.createElement('iframe');
iframe.id ="refreshToken";
iframe.setAttribute('src',"/connect/tokenclient_id=client1& client_secret=secret&grant_type=authorization_code&code=hdh922&redirect_uri=https://myapp.com/callback");
document.body.appendChild(iframe)
}
如果用户空闲同时又调用了silentrefresh,则用户的空闲时间被中断并重新启动。
我已经尝试从 iframe 中访问其他一些 URL,但这并没有中断空闲。它只发生在身份服务器的情况下
解决方案
推荐阅读
- python-3.x - Python:在以下代码中修复什么以使其运行?
- ruby-on-rails - 如何使用rest-client在rails中显示特定数据
- apache-spark - 我应该使用哪个版本的 hadoop-aws
- java - 当 -Xmx 设置为超过 1g 时,分叉的 VM 没有正确告别就终止了
- python - 计算机在 python 仍在运行时重新启动,但现在无法恢复
- elasticsearch - 如何使用字符串匹配获取日志(例如:包含“DEBUG”的日志)
- java - 如何在 Mapbox Android 上添加多个图层?
- android - 如何在 OSM(打开地图街道)的 Android Studio 中绘制一条线(Polyline)?
- python - 在遗传算法中选择父母
- excel - 如何在 Excel 中计算“-”