asp.net-mvccookiesbearer-tokenauthorize-attributecookie-authentication

Bearer token authentication with cookie


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.


Solution

  • 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/