Package org.springframework.security.authorization

# Class AuthenticatedAuthorizationManager<T>

java.lang.Object
org.springframework.security.authorization.AuthenticatedAuthorizationManager<T>

Type Parameters:
  `T` - the type of object authorization is being performed against. This does not.

All Implemented Interfaces:
  `AuthorizationManager<T>`

public final class AuthenticatedAuthorizationManager<T> extends Object implements AuthorizationManager<T>
An `AuthorizationManager` that determines if the current user is authenticated.

Since:
  5.5

## Constructor Summary

Constructors
Constructor
Description
`AuthenticatedAuthorizationManager()`
Creates an instance that determines if the current user is authenticated, this is the same as calling `authenticated()` factory method.

## Method Summary

Modifier and Type
Method
Description
`static <T> AuthenticatedAuthorizationManager<T>`
`anonymous()`
Creates an instance of `AuthenticatedAuthorizationManager` that determines if the `Authentication` is anonymous.
`static <T> AuthenticatedAuthorizationManager<T>`
`authenticated()`
Creates an instance of `AuthenticatedAuthorizationManager`.
`AuthorizationDecision`
`check(Supplier<Authentication> authentication, T object)`
Determines if the current user is authorized according to the given strategy.
`static <T> AuthenticatedAuthorizationManager<T>`
`fullyAuthenticated()`
Creates an instance of `AuthenticatedAuthorizationManager` that determines if the `Authentication` is authenticated without using remember me.
`static <T> AuthenticatedAuthorizationManager<T>`
`rememberMe()`
Creates an instance of `AuthenticatedAuthorizationManager` that determines if the `Authentication` is authenticated using remember me.
`void`
`setTrustResolver(AuthenticationTrustResolver trustResolver)`
Sets the `AuthenticationTrustResolver` to be used.

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

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

### Methods inherited from interface org.springframework.security.authorization.AuthorizationManager

`authorize, verify`

## Constructor Details

### AuthenticatedAuthorizationManager

public AuthenticatedAuthorizationManager()
Creates an instance that determines if the current user is authenticated, this is the same as calling `authenticated()` factory method.

Since:
  5.8
See Also:
  - `authenticated()`
  - `fullyAuthenticated()`
  - `rememberMe()`
  - `anonymous()`

## Method Details

### setTrustResolver

public void setTrustResolver(AuthenticationTrustResolver trustResolver)
Sets the `AuthenticationTrustResolver` to be used. Default is `AuthenticationTrustResolverImpl`. Cannot be null.

Parameters:
  `trustResolver` - the `AuthenticationTrustResolver` to use
Since:
  5.8

### authenticated

public static <T> AuthenticatedAuthorizationManager<T> authenticated()
Creates an instance of `AuthenticatedAuthorizationManager`.

Type Parameters:
  `T` - the type of object being authorized
Returns:
  the new instance

### fullyAuthenticated

public static <T> AuthenticatedAuthorizationManager<T> fullyAuthenticated()
Creates an instance of `AuthenticatedAuthorizationManager` that determines if the `Authentication` is authenticated without using remember me.

Type Parameters:
  `T` - the type of object being authorized
Returns:
  the new instance
Since:
  5.8

### rememberMe

public static <T> AuthenticatedAuthorizationManager<T> rememberMe()
Creates an instance of `AuthenticatedAuthorizationManager` that determines if the `Authentication` is authenticated using remember me.

Type Parameters:
  `T` - the type of object being authorized
Returns:
  the new instance
Since:
  5.8

### anonymous

public static <T> AuthenticatedAuthorizationManager<T> anonymous()
Creates an instance of `AuthenticatedAuthorizationManager` that determines if the `Authentication` is anonymous.

Type Parameters:
  `T` - the type of object being authorized
Returns:
  the new instance
Since:
  5.8

### check

public AuthorizationDecision check(Supplier<Authentication> authentication, T object)
Determines if the current user is authorized according to the given strategy.

Specified by:
  `check` in interface `AuthorizationManager<T>`
Parameters:
  `authentication` - the `Supplier` of the `Authentication` to check
  `object` - the `AuthenticatedAuthorizationManager` object to check
Returns:
  an `AuthorizationDecision`