Jul 25, 2020 11:42 PM|MarcusAtMars|LINK
I am trying to create my own custom login screen to use instead of the windows authentication popup window. I have already gotten a lot of help from you guys (thanks, Bruce!), but I now have a strange error that confuses me.
I was told that I should use PrincipleContext to validate my credentials and then create an identity for .net core security. I don't quite understand what that means, and there isn't any documentation on "creating" an identity. How do I do that?
I tried to figure this out on my own, and figured I needed to use SignInManager to do that. However, when executing `_signInManager.PasswordSignInAsync` in my app, my app displays this error:
Cannot open database "WebApp_Redesign" requested by the login. The login failed.
Login failed for user 'domain\username'
So does this error indicate that I cannot log into my windows account this way, or is there a step I need to do before I attempt to sign in? My full code is below. I simply post my form with the username and password to this controller class.
private readonly UserManager<WebApp_RedesignUser> _userManager;
. . .
public async Task<ActionResult> UserLoginAsync(LoginModel user)
if (user != null)
var result = await _signInManager.PasswordSignInAsync(user.username, user.password, isPersistent: false, lockoutOnFailure: false);