How to sign out other user in ASP.NET Core Identity

后端 未结 2 1594
时光说笑
时光说笑 2020-12-08 01:34

How can i sign out another user (not the currently logged one) in ASP.NET Core Identity.

I know there is a SignOutAsync() method in SignInManager, but t

2条回答
  •  佛祖请我去吃肉
    2020-12-08 01:49

    I think you might find some revoke functionality, which make sign out user forcefully. It is not easily implemented currently as the nature of stateless connection and token-based (or we can say claim-based) authentication.

    A revoked user should be accessed to a token validation endpoint in order to check the token valid or not. Until then, (1) the user could be shown as a signed-in, or (2) we need to implement client(app or web) to access to the token endpoint very frequently till token expiration or revokation.

    SignIn/Out is tighted to token-authorized user identity scope, so that the viable solution is to invalidate a token.

提交回复
热议问题