Quantcast
Channel: MySQL Forums - Connector/NET and C#, Mono, .Net
Viewing all articles
Browse latest Browse all 1447

Entity Framework + MySql + resetPassword (no replies)

$
0
0
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

Viewing all articles
Browse latest Browse all 1447

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>