Login failure med login control & password recovery
Via ASP.net 2.0, har jeg lavet et login aspx side hvorpå jeg har tilføjet en login control. Vha asp.net config har jeg oprettet en bruger, og tildelt denne en rolle.Jeg kan efterfølgende finde denne folder i ASPNETDB.MDF DB.
Men når jeg efterfølgende forsøger et login med denne brugher og id får jeg altid invalid signon...
Jeg ved flere andre har det samme problem, det driver mig til vanvid !!!
Desuden har jeg lavet endnu en side med en password recovery control. Når jeg indtaster brugerid mm. og klikker på submit skriver asp.net at den har sendt mig mit password via mail.
Jeg modtager skam også en mail på den ønskede mailadresse som angivet for brugeren, problemet er lidt at jeg ikke har nogdet pwd i mailen...
Det begrænser lidt værdien lidt... Se min web.config fil nedenfor:
<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings/>
<connectionStrings>
<add name="MinibankConnectionString" connectionString="Data Source=SERVER5;Initial Catalog=Minibank;Integrated Security=True" providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<anonymousIdentification enabled="true" />
<profile>
<properties>
<add name="Name" allowAnonymous="true" />
<add name="FirstVisit" type="System.DateTime" allowAnonymous="true" />
</properties>
</profile>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true"/>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Forms" />
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
</system.web>
<system.net>
<mailSettings>
<smtp from="JJ">
<network host="Smtp.mail.dk" password="" userName="" />
</smtp>
</mailSettings>
</system.net>
</configuration>
---------------------------
Jeg har snust mig frem til at jeg kal tilføje et <membership>
<providers> afsnit, men kan ikke få det til at fungere:
<membership>
<providers>
<clear/>
<add name="AspNetSqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider, System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="MinibankConnectionString"
enablePasswordRetrieval="true" enablePasswordReset="true"
requiresQuestionAndAnswer="true"
applicationName="marscg" requiresUniqueEmail="true"
passwordFormat="Hashed" Passwordreset="true"
Passwordretriaval="true" maxInvalidPasswordAttempts="5"
minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0"
passwordAttemptWindow="10" passwordStrengthRegularExpression=""/>
</providers>
</membership>