Package org.springframework.security.authorization.event

# 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
A parent class for `AuthorizationGrantedEvent` and `AuthorizationDeniedEvent`.

Since:
  5.8
See Also:
  - Serialized Form

## Field Summary

### Fields inherited from class java.util.EventObject

`source`

## Constructor Summary

Constructors
Constructor
Description
`AuthorizationEvent(Supplier<Authentication> authentication, Object object, AuthorizationDecision result)`
Construct an `AuthorizationEvent`
`AuthorizationEvent(Supplier<Authentication> authentication, Object object, AuthorizationResult result)`
Construct an `AuthorizationEvent`

## Method Summary

Modifier and Type
Method
Description
`Supplier<Authentication>`
`getAuthentication()`
Get the principal requiring access
`AuthorizationDecision`
`getAuthorizationDecision()`
Deprecated.
please use `getAuthorizationResult()`
`AuthorizationResult`
`getAuthorizationResult()`
Get the response to the principal's request
`Object`
`getObject()`
Get the object to which access was requested

### Methods inherited from class org.springframework.context.ApplicationEvent

`getTimestamp`

### Methods inherited from class java.util.EventObject

`getSource, toString`

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

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

## Constructor Details

### AuthorizationEvent

public AuthorizationEvent(Supplier<Authentication> authentication, Object object, AuthorizationDecision result)
Construct an `AuthorizationEvent`

Parameters:
  `authentication` - the principal requiring access
  `object` - the object to which access was requested
  `result` - whether authorization was granted or denied

### AuthorizationEvent

public AuthorizationEvent(Supplier<Authentication> authentication, Object object, AuthorizationResult result)
Construct an `AuthorizationEvent`

Parameters:
  `authentication` - the principal requiring access
  `object` - the object to which access was requested
  `result` - 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

@Deprecated public AuthorizationDecision getAuthorizationDecision()
Deprecated.
please use `getAuthorizationResult()`
Get the response to the principal's request

Returns:
  the response to the principal's request

### getAuthorizationResult

public AuthorizationResult getAuthorizationResult()
Get the response to the principal's request

Returns:
  the response to the principal's request
Since:
  6.4