PasswordHasherの入れ替え
[csharp]
public class ApplicationUserManager : UserManager
{
public ApplicationUserManager(IUserStore store) : base(store) { }
public static ApplicationUserManager Create(IdentityFactoryOptions options, IOwinContext context)
{
var manager = new ApplicationUserManager(new UserStore(context.Get()));
manager.PasswordHasher = new HogePasswordHasher();
return manager;
}
}
public class HogePasswordHasher : IPasswordHasher
{
public string HashPassword(string password)
{
// 塩を振ったりストレッチングしたりしよう
throw new NotImplementedException();
}
public PasswordVerificationResult VerifyHashedPassword(string hashedPassword, string providedPassword)
{
if (hashedPassword == HashPassword(providedPassword))
return PasswordVerificationResult.Success;
else
return PasswordVerificationResult.Failed;
}
}
[/csharp]