Class AuthenticationObservationContext

java.lang.Object
io.micrometer.observation.Observation.Context
org.springframework.security.authentication.AuthenticationObservationContext
All Implemented Interfaces:
io.micrometer.observation.Observation.ContextView

public class AuthenticationObservationContext extends io.micrometer.observation.Observation.Context
An Observation.Context used during authentications
Since:
6.0
  • Constructor Details

    • AuthenticationObservationContext

      public AuthenticationObservationContext()
  • Method Details

    • getAuthenticationRequest

      public @Nullable Authentication getAuthenticationRequest()
      Get the Authentication request that was observed
      Returns:
      the observed Authentication request
    • setAuthenticationRequest

      public void setAuthenticationRequest(Authentication authenticationRequest)
      Set the Authentication request that was observed
      Parameters:
      authenticationRequest - the observed Authentication request
    • getAuthenticationResult

      public @Nullable Authentication getAuthenticationResult()
      Get the Authentication result that was observed

      Note that if authentication failed, no Authentication result can be observed. In that case, this returns null.

      Returns:
      any observed Authentication result, null otherwise
    • setAuthenticationResult

      public void setAuthenticationResult(Authentication authenticationResult)
      Set the Authentication result that was observed
      Parameters:
      authenticationResult - the observed Authentication result
    • getAuthenticationManagerClass

      public @Nullable Class<?> getAuthenticationManagerClass()
      Get the AuthenticationManager class that processed the authentication
      Returns:
      the observed AuthenticationManager class
    • setAuthenticationManagerClass

      public void setAuthenticationManagerClass(Class<?> authenticationManagerClass)
      Set the AuthenticationManager class that processed the authentication
      Parameters:
      authenticationManagerClass - the observed AuthenticationManager class