作者:静-静-静距离 | 来源:互联网 | 2023-05-17 12:27
Imusingasp.netMVCandASP.netIdentity2.0.我正在使用asp.netMVC和ASP.netIdentity2.0。Onmywebsit
I'm using asp.net MVC and ASP.net Identity 2.0.
我正在使用asp.net MVC和ASP.net Identity 2.0。
On my website Admin has option to ban user, and I would like when user is banned that he is automatically signed-out from website.
在我的网站上Admin可以选择禁止用户,我希望当用户被禁止他自动从网站注销时。
I know that I can sign-out current user by calling
我知道我可以通过电话退出当前用户
AuthenticationManager.SignOut();
But is it possible to sign-out another user ? Or maybe shorter his session ? Or anything ?
但是可以注销另一个用户吗?或者可能会缩短他的课程?还是什么?
I know I could make global filter on controllers prohibiting banned users from access but that filter would be ran against each user so I'm not quiet satisfied with that solution.
我知道我可以对控制器进行全局过滤,禁止禁止用户访问但是过滤器会针对每个用户运行,所以我对这个解决方案并不满意。
2 个解决方案