Entity Framework + MySql + resetPassword
Posted by: Massimo Mondino
Date: March 10, 2017 01:32AM

Hi all,

is there a way to reset the password of some users? My app is using EF and MySQL as database (the version of .NET connector is 6.9.9). What I did and throwing me an exception is:

try
{
string token = MySql.Web.Security.MySqlWebSecurity.GeneratePasswordResetToken(user.Name);
MySql.Web.Security.MySqlWebSecurity.ResetPassword(token, "pass");
}

The point is:
token is always null but I'm sure the user exists. So, I have tried to search about that error on Internet and I have found that:
https://bugs.mysql.com/bug.php?id=75411


Then I have downloaded the source of the connector https://dev.mysql.com/downloads/connector/net/6.9.html (I'm using the 6.9.9 version) and changed the line mentioned above. Building the solution I got the new MySql.Web.dll and referenced it in my project. But nothing change. I keep getting a null token :-(

Just for testing I have also changed that line of code in my sql connector source:

public static string GeneratePasswordResetToken(string userName, int tokenExpirationInMinutesFromNow = 1440)
{
var provider = ValidProvider();
//return provider.GeneratePasswordResetToken(userName, tokenExpirationInMinutesFromNow);
return "Test";
}
so I should always get "Test" as token, right? But nothing --> always null. So I see 2 way to go:

- is there some other methods to allow users reset their password?

- am I failing something during the build process of MySql.Web.dll?

Some help it's really appreciate. Thanks

Options: ReplyQuote


Subject
Written By
Posted
Entity Framework + MySql + resetPassword
March 10, 2017 01:32AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.