If you are using Microsoft.AspNet.Identity.EntityFramework from the MVC app and the WinForm app has access to the same database, then you should configure it to use the same ConnectionString as the MVC application.
Add Microsoft.AspNet.Identity.EntityFramework to the WinForm application using nuget.
Then the following code can be used to verify username and password:
public async Task<bool> VerifyUserNamePassword(string userName, string password)
{
var usermanager = new UserManager<IdentityUser>(new UserStore<IdentityUser>(new IdentityDbContext()));
return await usermanager.FindAsync(userName, password) != null;
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…