public void OnAuthorization(AuthorizationContext filterContext)
 {
     if (!_authentication.Authorize(filterContext.HttpContext))
     {
         throw new UnauthorizedAccessException();
     }
 }
 public void OnAuthorization(AuthorizationContext filterContext)
 {
     if (!_authentication.Authorize(filterContext.HttpContext))
     {
         filterContext.Result = new HttpUnauthorizedResult();
     }
 }
예제 #3
0
 private void ButtonlogOn_Click(object sender, System.EventArgs e)
 {
     authenticationProcess.Authorize(new UserCredential()
     {
         Name = textBoxLogin.Text, Password = textBoxPassword.Text
     });
     ClearTextFields();
     Activate();
 }
예제 #4
0
        public async Task <IActionResult> Authorize([FromBody] Credentials credentials)
        {
            var token = await _authentication.Authorize(credentials);

            return(Json(token));
        }