[C#]Authentification qui échoue : a chaque fois "Login inco
Bonjour a tous,
Impossible d'arriver à accéder a ma partie Admin.
Voici mon web.config placé dans ma partie Admin (donc j'en ai un autre avec les config par défaut a ma racine) :
Code:
1 2 3 4 5 6 7 8 9 10
| <authentication mode="Forms">
<forms loginUrl="../login.aspx" timeout="20">
<credentials passwordFormat="MD5">
<user name="Administrateur" password="098F6BCD4621D373CADE4E832627B4F6" />
</credentials>
</forms>
</authentication>
<authorization>
<deny users="?" />
</authorization> |
Donc login Administrateur et MDP "test" au format MD5.
Voici le code de ma page Login.aspx a la racine :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
| <%@ Import Namespace=" System.Web.Security" %>
<script language="C#" runat="server">
private void ValidStart(object sender, System.EventArgs e)
{
if (FormsAuthentication.Authenticate(TxtBLogin.Text,TxtBPwd.Text))
{
FormsAuthentication.RedirectFromLoginPage(TxtBLogin.Text,false );
}
else
{
lbMessage.Text = "Login incorrect !";
}
}
</script>
<% titre = "Identification - Photographe COLT"; %>
<% titre_page = "Identification"; %>
<!-- #include file="haut.aspx"-->
<form id="FormLogin" method="post" runat="server">
<table class="clogin" align="center" border="0">
<tr>
<td><asp:label id="textID" runat="server" Font-Underline="True">Login :</asp:label></td>
<td><asp:textbox id="TxtBLogin" runat="server"></asp:textbox></td>
</tr>
<tr>
<td><asp:label id="textPWD" runat="server" Font-Underline="True">Mot de passe :</asp:label></td>
<td><asp:textbox id="TxtBPwd" TextMode="password" runat="server"></asp:textbox></td>
</tr>
<tr>
<td align="center" colspan="2"><asp:button id="Button1" onclick="ValidStart" runat="server" Text="Button"></asp:button></td>
</tr>
<tr>
<td align="center" colspan="2"><asp:Label id="lbMessage" runat="server" Font-Size="Medium" ForeColor="Red"></asp:Label></td>
</tr>
</table>
</form>
<!-- #include file="bas.aspx"--> |
Je me suis insipiré de cette page : http://dotnet.developpez.com/tutorie...hentification/ mais j'ai tout le temps login incorrect :'(
Merci pour votre aide :)