24 Şubat 2019 Pazar

SpringSecurity AuthenticationFailureHandler Arayüzü

Örnek
Şöyle yaparız.
@Component
public class CustomAuthenticationFailureHandler implements AuthenticationFailureHandler
{
  @Override
  public void onAuthenticationFailure(HttpServletRequest request,
                                      HttpServletResponse response,
      AuthenticationException ex) throws IOException, ServletException
  {
    response.setStatus(HttpStatus.UNAUTHORIZED.value());
    ...
  }
}

Hiç yorum yok:

Yorum Gönder