[AllowAnonymous] attribute
MVC application provides an “AllowAnonymous” attribute to allow the user to access the Views without logging into the application. ie. It will allow the anonymous user to access the website.
This attributes are mainly used in “Login” view screen and other general view open to every one
In the below example code “Account” controller will be able to access by authorize user but “Login” view inside the controller can be access by anonymous users(any one).
Example: