Bug #75411 Does not generate password reset token
Submitted: 5 Jan 2015 15:53 Modified: 13 Jan 2015 17:19
Reporter: Yaroslav Mudrik Email Updates:
Status: In review Impact on me:
Category:Connector / NET Severity:S2 (Serious)
Version: OS:Windows
Assigned to: Assigned Account CPU Architecture:Any
Tags: MySqlSimpleMembershipProvider

[5 Jan 2015 15:53] Yaroslav Mudrik
I use MySqlSimpleMembershipProvider and try to get password reset token by this code:

var token = WebSecurity.GeneratePasswordResetToken("Yarik");

User "Yarik" exist. After this code execution the token is null. WebSecurity was initialized.

How to repeat:
Create simple ASP.NET MVC application. Setup it for user MySqlSimpleMembershipProvider. Call in code function:

var token = WebSecurity.GeneratePasswordResetToken(existUserName);

Suggested fix:
I found bug in MySqlSimpleMembershipProvider.cs. Line 387. 

Replace "if (token != null)" to "if (token == null)"
[6 Jan 2015 18:39] Gabriela Martinez Sanchez
Verified with C/net 6.9.x
[17 Feb 2015 6:01] Chiranjeevi Battula
Bug#75922 marked as duplicate of this one.
[13 Sep 2015 3:05] Buvic Stoyanovic
Please, please fix it already
[12 Oct 2016 6:57] Chiranjeevi Battula
http://bugs.mysql.com/bug.php?id=82721 marked as duplicate of this one.
[2 Nov 2016 18:16] Stein Setvik
Patch generated against 6.9.9

Attachment: mysql-bug-75411-generatepasswordresettoken.patch (application/octet-stream, text), 990 bytes.

[2 Nov 2016 18:17] Stein Setvik
Bug confirmed in 6.9.9 and 7.x. Suggested fix works. Generated and attached patch against 6.9.9