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

War es hilfreich?

Lösung 3

Here is the question with better description, and the answer:

Forms Authentication & authorization MVC 4

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

IIS Anonymous Authentication

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top