Class AuthorizationEvent

java.lang.Object
java.util.EventObject
org.springframework.context.ApplicationEvent
org.springframework.security.authorization.event.AuthorizationEvent
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AuthorizationDeniedEvent, AuthorizationGrantedEvent

public class AuthorizationEvent extends org.springframework.context.ApplicationEvent
Since:
5.8
See Also:
  • Constructor Details

    • AuthorizationEvent

      public AuthorizationEvent(Supplier<Authentication> authentication, Object object, AuthorizationDecision decision)
      Construct an AuthorizationEvent
      Parameters:
      authentication - the principal requiring access
      object - the object to which access was requested
      decision - whether authorization was granted or denied
  • Method Details

    • getAuthentication

      public Supplier<Authentication> getAuthentication()
      Get the principal requiring access
      Returns:
      the principal requiring access
    • getObject

      public Object getObject()
      Get the object to which access was requested
      Returns:
      the object to which access was requested
    • getAuthorizationDecision

      public AuthorizationDecision getAuthorizationDecision()
      Get the response to the principal's request
      Returns:
      the response to the principal's request