Is there a native ASP.NET Core method for securing endpoints via a Session Cookie? I have successfully implemented a Session using a Cosmos backing store by following the article on MSFT but have yet to figure out how to translate that into securing my endpoints.
Cookie authentication seems like the way to go but I cannot figure out how to quite get it right.
I feel like by using:
services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
.AddCookie();
I am instead creating another cookie instead of reusing the one given to me by the Session middleware.
Ultimately, I want to be able to only allow for specific endpoints to be called if the user has a session and it is a valid one. Thanks!