ASP.NET Core 2
Help me to configure AddAuthentication
for two routes: users (user accounts) and admin area.
For example, if user doesn't signed in and trying to enter /Account/Orders/
he'll be redirected to /Account/SignIn/
.
But if someone trying access /Admin/Orders/
must be redireted to /Admin/Signin/
Have not found ay solution ATM.
Solved!
In
admin
area (controllers) we using Authorize attr. arg.:[Authorize(AuthenticationSchemes = "backend")]
and that is.BTW we are able to make any tuning by accessing HttpContext in AddCookie's options and events.
Configuration: