Class SecurityEvent

java.lang.Object
java.util.EventObject
io.micronaut.context.event.ApplicationEvent
io.micronaut.security.event.SecurityEvent
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
LoginFailedEvent, LoginSuccessfulEvent, LogoutEvent, TokenValidatedEvent

@Internal public abstract class SecurityEvent extends io.micronaut.context.event.ApplicationEvent
Base class for security events.
Since:
4.7.0
Author:
Tim Yates
See Also:
  • Constructor Details

    • SecurityEvent

      protected SecurityEvent(Object source, String host, Locale locale)
      Parameters:
      source - The source of the event
      host - The hostname from the request if available
      locale - The locale of the request
  • Method Details

    • getHost

      public String getHost()
      Returns:
      The hostname from the request if available
    • getLocale

      public Locale getLocale()
      Returns:
      The locale of the request
    • toString

      public String toString()
      The string representation never includes the source. Micronaut logs every published event at DEBUG using its string representation, and the source may carry tokens or an authentication with sensitive attributes.
      Overrides:
      toString in class EventObject
      Returns:
      The string representation of the event with the source redacted.
      Since:
      5.5.2