Here is the question with better description, and the answer:
MVC 4 Form Authentication - Cannot access any other action beside the one declared on the web.config
-
13-04-2022 - |
Frage
This is my settings at web.config:
<authentication mode="Forms">
<forms loginUrl="~/Login/Login" timeout="2880" />
</authentication>
On my controller I have few actions, on every action I added [AllowAnonymous] decoration, but I'm getting redirection from every action to the Login action.
I even tried to add [AllowAnonymous] decoration to the controller, but it doesn't help.
Thanks
Lösung 3
Andere Tipps
I had a similar issue and resolved it by adding the following to my web.config
<location path="Login">
<system.web>
<authorization>
<allow users="?" />
</authorization>
</system.web>
</location>
I also had to add similar location statements to get my stylesheets, scripts, and images available prior to authentication.
Edit 1
I realized that I actually ran into this issue while running my MVC app as an application in a virtual directory, instead of being the base site. YMMV.
I recently encountered this problem. Some of our team members had to switch Specific user
to Application pool identity
in IIS Authentication settings.
Anonymous Authentication enabled