2

I am trying to use the ASP.NET forms authentication service with the MySQL connector version 6.3.2. I was able to get it working using cleartext passwords but unable to get hashed passwords working. Here is a snippet from my machine.config file

<system.web>
  <membership defaultProvider="MySQLMembershipProvider">
    <providers>
      <add name="MySQLMembershipProvider" 
    type="MySql.Web.Security.MySQLMembershipProvider, MySql.Web, Version=6.3.2.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" 
    autogenerateschema="true"
    connectionStringName="LocalMySqlServer" 
    enablePasswordRetrieval="false" 
    enablePasswordReset="true" 
    requiresQuestionAndAnswer="false" 
    applicationName="/" 
    requiresUniqueEmail="true" 
    passwordFormat="Hashed" 
    maxInvalidPasswordAttempts="5" 
    minRequiredPasswordLength="6" 
    minRequiredNonalphanumericCharacters="1" 
    passwordAttemptWindow="10" 
    passwordStrengthRegularExpression="" />
    </providers>
  </membership>
</system.web>

I am using the ValidateUser method of the MembershipProvider class to perform authentication. If the line passwordFormat="Hashed" is changed to passwordFormat="Clear" users will authenticate. After changing settings in the machine.config file I remove all users and recreate the accounts. I inspected the contents of the aspnet tables and the passwords are being stored properly as hashes - just failing to verify.

1
  • 1
    Thank you so much @dcompiled. Your answer saved my work day! :D Commented Mar 4, 2011 at 1:33

1 Answer 1

4

Looks like I'm not the only one who has noticed this bug: http://forums.mysql.com/read.php?38,368612,372250. Easily fixed by adding the following to the web.config:

<system.web>
  <machineKey validationKey="AutoGenerate" validation="SHA1" />
</system.web>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.