Package org.springframework.security.web.authentication

# Class AuthenticationEntryPointFailureHandler

java.lang.Object
org.springframework.security.web.authentication.AuthenticationEntryPointFailureHandler

All Implemented Interfaces:
  `AuthenticationFailureHandler`

public class AuthenticationEntryPointFailureHandler extends Object implements AuthenticationFailureHandler
Adapts a `AuthenticationEntryPoint` into a `AuthenticationFailureHandler`

Since:
  5.2.0

## Constructor Summary

Constructors
Constructor
Description
`AuthenticationEntryPointFailureHandler(AuthenticationEntryPoint authenticationEntryPoint)`

## Method Summary

Modifier and Type
Method
Description
`void`
`onAuthenticationFailure(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.security.core.AuthenticationException exception)`
Called when an authentication attempt fails.
`void`
`setRethrowAuthenticationServiceException(boolean rethrowAuthenticationServiceException)`
Set whether to rethrow `AuthenticationServiceException`s (defaults to true)

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### AuthenticationEntryPointFailureHandler

public AuthenticationEntryPointFailureHandler(AuthenticationEntryPoint authenticationEntryPoint)

## Method Details

### onAuthenticationFailure

public void onAuthenticationFailure(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.security.core.AuthenticationException exception) throws IOException, jakarta.servlet.ServletException
Description copied from interface: `AuthenticationFailureHandler`
Called when an authentication attempt fails.

Specified by:
  `onAuthenticationFailure` in interface `AuthenticationFailureHandler`
Parameters:
  `request` - the request during which the authentication attempt occurred.
  `response` - the response.
  `exception` - the exception which was thrown to reject the authentication request.
Throws:
  `IOException`
  `jakarta.servlet.ServletException`

### setRethrowAuthenticationServiceException

public void setRethrowAuthenticationServiceException(boolean rethrowAuthenticationServiceException)
Set whether to rethrow `AuthenticationServiceException`s (defaults to true)

Parameters:
  `rethrowAuthenticationServiceException` - whether to rethrow `AuthenticationServiceException`s
Since:
  5.8