【发布时间】:2016-07-08 17:02:07
【问题描述】:
我希望主管能够为用户覆盖
例如。人未通过检查,需要主管来验证是否可以继续。
我目前有一个从视图返回用户名和密码的表单。我希望能够在不登录的情况下验证他们是主管。
控制器:
[HttpPost]
[AllowAnonymous]
[ValidateAntiForgeryToken]
public async Task<IActionResult> verify(verifyViewModel model)
{ //this creates the user and their subdomain
string str_UserName = model.UserName + "@" + model.Subdomain;
var verify = await _userManager.VerifyPasswordAsync(str_UserName, model.Password);
if (verify == true){ continue with program }
型号:
public class verifyViewModel
{
[Required]
public string Subdomain { get; set; }
[Required]
public string UserName { get; set; }
[Required]
[DataType(DataType.Password)]
public string Password { get; set; }
}
与
_userManager.VerifyPasswordAsync(str_UserName, model.Password);
我想我错过了一些东西,但我不知道从哪里继续
【问题讨论】:
标签: asp.net-core asp.net-identity asp.net-core-mvc