How to replace the contents of the cookie with jwt token?

Viewed 46

Link: https://docs.microsoft.com/en-us/aspnet/core/security/authentication/cookie?view=aspnetcore-6.0

HttpContext.SignInAsync generates the cookie and sends it in the response.

  1. In the browser when I look at the cookie it contains jumbled alphabets - so is the cookie encrypted?

  2. Assuming I generate a JWT upon successful user credential check, then I can return the JWT directly without making use of HttpContext.SignInAsync. Does HttpContext.SignInAsync suppose any method so that I can put the JWT into the cookie so that I don't have to return it directly?

0 Answers
Related