views:

19

answers:

1

Hi

Hi have a form that call an Action properly. But when i enable the authentication forms, the action to login doesn't fire up (i test it with a breakpoint).

My Web.config is:

    <authentication mode="Forms">
    <forms loginUrl="Autenticacao/Index"></forms>
    </authentication>
    <authorization>
    <deny users="?"/>
    </authorization>

It's in the view Index of controller Autenticacao where i have my form:

    <% Html.BeginForm("Login", "Autenticacao"); %>
    <input type="text" id="autenticacaoReferencia" name="autenticacaoReferencia" /><br />
    <input type="text" id="autenticacaoPassword" name="autenticacaoPassword" /><br />
    <input type="submit" value="Entrar" />
    <% Html.EndForm(); %>

The controller Login is sucefully called just if the authentication form is disable.

Am i using the BeginForm in a wrong way?

Edit: The Login action:

    public ActionResult Login(string autenticacaoReferencia, string autenticacaoPassword, string returnUrl)
    {
    ...
    }

Thanks

A: 

Are you decorating your actions with the [Authorize] attribute?

UpTheCreek
Do i need an atribute in the Action "Login"? I'm just using the [Authorize] in the class's i need user to be authenticated
Guilherme Cardoso
No, sounds like you are using it correctly.
UpTheCreek
I've removed the users="?" from denny and it's working now. (it's reendirecting to Authentication page when it's not authenticated as well.
Guilherme Cardoso