Answer the question
In order to leave comments, you need to log in
C# ASP.MVC - where does the authorization check and the corresponding routing take place?
Good afternoon!
There is an asp.mvc project in which authorization is implemented.
If the user is not authorized, then he cannot see pages to which only authorized access is possible.
When trying to enter such a page, the user is redirected to the authorization page.
The question is how to find where the authorization check condition and routing to the authorization page are specified.
Answer the question
In order to leave comments, you need to log in
So the entire project setup is in class Startup and most likely the url for the authorization page is set there.
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
LoginPath = new PathString("/Account/Login"),
...
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question