public async Task <IActionResult> Ntlm(string returnUrl = null) { if (this.User.Identity.IsAuthenticated == false) { var defaultProperties = new AuthenticationProperties() { RedirectUri = returnUrl }; var authContext = new Http.Features.Authentication.AuthenticateContext(ActiveDirectoryOptions.DefaultAuthenticationScheme); await HttpContext.Authentication.AuthenticateAsync(authContext); if (!authContext.Accepted || authContext.Principal == null) { return(new UnauthorizedResult()); } } if (string.IsNullOrWhiteSpace(returnUrl)) { return(new OkResult()); } else { return(Redirect(returnUrl)); } }
public async Task<IActionResult> Ntlm(string returnUrl = null) { if (this.User.Identity.IsAuthenticated == false) { var defaultProperties = new AuthenticationProperties() { RedirectUri = returnUrl }; var authContext = new Http.Features.Authentication.AuthenticateContext(ActiveDirectoryOptions.DefaultAuthenticationScheme); await HttpContext.Authentication.AuthenticateAsync(authContext); if (!authContext.Accepted || authContext.Principal == null) { return new UnauthorizedResult(); } } if (string.IsNullOrWhiteSpace(returnUrl)) return new OkResult(); else return Redirect(returnUrl); }