Autoriser l'accès Anonyme à l'appel de certaines actions dans asp.net mvc 3

J'ai une action nommée ForgetPassword. Chaque fois qu'un anonyme tente de récupérer les mesures, il est redirigé vers la Page de Connexion. Ci-dessous sont mes implémentations.

public ActionResult ForgotPassword(string UserName)
{
    //More over when i place a breakpoint for the below line 
    //its not even getting here
    return View("Login");
}

Et voici une partie de mon web.fichier de configuration

    <location path="">
        <system.web>
          <authorization>
            <deny users="?"/>
          </authorization>
        </system.web>    
      </location>

  <location path="Content">
    <system.web>
      <authorization>
        <allow users="*"/>
      </authorization>
    </system.web>    
  </location>

  <location path="Scripts">
    <system.web>
      <authorization>
        <allow users="*"/>
      </authorization>
    </system.web>    
  </location>

  <location path="Images">
    <system.web>
      <authorization>
        <allow users="*"/>
      </authorization>
    </system.web>    
  </location>

<authentication mode="Forms">
  <forms loginUrl="/Home/Login" timeout="5" slidingExpiration="false" />
</authentication>
  • Avez-vous décorer votre Controller/Action avec Authorize attribut, ou enregistré un mondial Authorize filtre?
InformationsquelleAutor Redone | 2013-07-10