One of the authentication and authorization patterns for. NET core is cookie-based, first we create a. NET Core MVC project:
Then increase the access control of the page, Conytroller add authorize property to the page to be accessed, and we add the support configuration of the cookie permission authentication in Start.cs, and then go to the page that needs to verify the permission to jump to the landing page:
Next we can increase the authorization code for the cookie:
We found that each authorization verification jump to the page is the Account/login page, this jump path is not customizable, the answer is of course. Here are the steps to proceed.
Well, an unidentified so the Cookie-base authentication and authorization feature is implemented, because. NET core is now open source, why we add the above to achieve a cookie-base certification and authorization, interested in viewing the source to explore
(Refer to the. NET Core video tutorial of the Ascendas Teacher (Jesse) for the above operation)
. Net Core cookie-based Certification and licensing