Authentification par formulaire : Problème de redirection
Bonjour,
Je souhaite authentifier des users en utilisant le mode formulaire. J'ai suivi les instructions affichées sur msdn(http://msdn.microsoft.com/fr-fr/libr...hy(VS.80).aspx)
Cela marche si je crée un projet spécialement pour tester l'authentification.
En revanche sur le projet final , ça ne marche pas. En fait le user est redirigé sur la page d'authentification (sans message d'erreur), alors qu'il devrait aller sur la page Default.aspx.
Voici les parties intéressantes des trois fichiers les plus importants :
Login.aspx
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| void btnLogIn_Click(object sender, EventArgs e)
{
if(bUserIsAuthentificated(txtLogin.Text
,txtPassword.Text))
{
vCreateSession(txtLogin.Text);
FormsAuthentication.RedirectFromLoginPage(txtLogin.Text, false);
Response.Redirect("Default.aspx?Parameter="
+ Server.UrlEncode(txtLogin.Text));
}
else
{
lblError.Text = m_sMsgErrorLogIn;
lblNote.Text = m_sMsgNoteLogIn;
lblError.Visible = true;
lblNote.Visible = true;
}
} |
Default.aspx
Code:
1 2 3 4 5 6 7
|
protected void BtnSignOut_Click(object sender, EventArgs e)
{
FormsAuthentication.SignOut();
Response.Redirect("frmIdentification.aspx", true);
} |
Web.config
Code:
1 2 3 4 5 6 7 8 9
| <authentication mode="Forms">
<forms loginUrl="frmIdentification.aspx"
name=".ASPXFORMSAUTH"
>
</forms>
</authentication>
<authorization>
<deny users="?"/>
</authorization> |
Pouvez-vous m'apporter des idées sur l'origine du problème