如何注销webapi? [英] How to signout a webapi?

查看:178
本文介绍了如何注销webapi?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的ac#webapi有角度web和android,ios应用程序。我将使用简单的基于令牌的身份验证。在登录时发出令牌并用于将来的请求。



问题是我如何取消/退出特定于不同设备的令牌,如网络(这也包括来自不同浏览器的请求)和移动设备。



客户可以同时从网络和移动设备登录,并且网络客户也可以使用浏览器或隐身窗口中的多个浏览器或多个帐户窗口登录。我知道这项工作可以在客户端完成,但我怎样才能在服务器端完成。



服务器端如何知道特定用户的请求来自所以它可以从数据库中删除该令牌以退出用户。



我尝试过的事情:



尝试了jwt,saml但找不到问题解决方案

I have a c# webapi having angular web and android, ios apps.I am going to use simple token based authentication.Token is issued at login time and used for future requests.

The problem is that how can i devalidate/logout a token of a specific for different devices like web(this also includes request from different browsers) and mobile.

The customer can login from web and mobile at same time and also on web customer can login using multiple browsers or multiple account windows in browser or incognito window. I know this work can be done at client side but how can i also do it server side.

How a server side knows that request for a specific user has came from where.So that it can remove that token from database to logout the user.

What I have tried:

Tried jwt , saml but could not find solution of problemc

推荐答案

这完全取决于WebApi。您必须查阅相关API的文档以了解如何执行此操作以及是否支持它。
That depends entirely on the WebApi. You'll have to consult the documentation of the API in question to find out how to do it and if it's even supported.


这篇关于如何注销webapi?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆