Class ObservationAuthenticationManager
java.lang.Object
org.springframework.security.authentication.ObservationAuthenticationManager
- All Implemented Interfaces:
AuthenticationManager
An
AuthenticationManager
that observes the authentication- Since:
- 6.0
-
Constructor Summary
ConstructorDescriptionObservationAuthenticationManager
(io.micrometer.observation.ObservationRegistry registry, AuthenticationManager delegate) -
Method Summary
Modifier and TypeMethodDescriptionauthenticate
(Authentication authentication) Attempts to authenticate the passedAuthentication
object, returning a fully populatedAuthentication
object (including granted authorities) if successful.void
setObservationConvention
(io.micrometer.observation.ObservationConvention<AuthenticationObservationContext> convention) Use the provided convention for reporting observation data
-
Constructor Details
-
ObservationAuthenticationManager
public ObservationAuthenticationManager(io.micrometer.observation.ObservationRegistry registry, AuthenticationManager delegate)
-
-
Method Details
-
authenticate
Description copied from interface:AuthenticationManager
Attempts to authenticate the passedAuthentication
object, returning a fully populatedAuthentication
object (including granted authorities) if successful.An
AuthenticationManager
must honour the following contract concerning exceptions:- A
DisabledException
must be thrown if an account is disabled and theAuthenticationManager
can test for this state. - A
LockedException
must be thrown if an account is locked and theAuthenticationManager
can test for account locking. - A
BadCredentialsException
must be thrown if incorrect credentials are presented. Whilst the above exceptions are optional, anAuthenticationManager
must always test credentials.
- Specified by:
authenticate
in interfaceAuthenticationManager
- Parameters:
authentication
- the authentication request object- Returns:
- a fully authenticated object including credentials
- Throws:
AuthenticationException
- if authentication fails
- A
-
setObservationConvention
public void setObservationConvention(io.micrometer.observation.ObservationConvention<AuthenticationObservationContext> convention) Use the provided convention for reporting observation data- Parameters:
convention
- The provided convention- Since:
- 6.1
-