带有cookie的承载令牌认证

问题描述:

我想使用Cookie在我的asp.net mvc应用程序中存储承载令牌,并且希望对Cookie进行每次身份验证以进行客户端身份验证(我不想添加"Autentication" 前端的每个请求的标头). 我该如何实施?谢谢.

I want to use Cookie for storing bearer token in my asp.net mvc application and I want that Cookie will be checked per request for client authentication (I don't want to add "Autentication" header for each request on the front-end). How can I implement it? Thank you.

您可以创建一个cookie提供程序来处理授权.检查一下 https://alexdunn .org/2017/03/31/asp-net-tips-using-bearer-tokens-as-a-cookie/

You can create a cookie provider to handle Authorization. Check this https://alexdunn.org/2017/03/31/asp-net-tips-consuming-bearer-tokens-as-a-cookie/