Interface AuthenticationTrustResolver
- All Known Implementing Classes:
AuthenticationTrustResolverImpl
public interface AuthenticationTrustResolver
Evaluates
Authentication
tokens-
Method Summary
Modifier and TypeMethodDescriptionboolean
isAnonymous
(Authentication authentication) Indicates whether the passedAuthentication
token represents an anonymous user.default boolean
isAuthenticated
(Authentication authentication) Checks if theAuthentication
is not null, authenticated, and not anonymous.default boolean
isFullyAuthenticated
(Authentication authentication) Indicates whether the passedAuthentication
token represents a fully authenticated user (that is, neither anonymous or remember-me).boolean
isRememberMe
(Authentication authentication) Indicates whether the passedAuthentication
token represents user that has been remembered (i.e.
-
Method Details
-
isAnonymous
Indicates whether the passedAuthentication
token represents an anonymous user. Typically the framework will call this method if it is trying to decide whether anAccessDeniedException
should result in a final rejection (i.e. as would be the case if the principal was non-anonymous/fully authenticated) or direct the principal to attempt actual authentication (i.e. as would be the case if theAuthentication
was merely anonymous).- Parameters:
authentication
- to test (may benull
in which case the method will always returnfalse
)- Returns:
true
the passed authentication token represented an anonymous principal,false
otherwise
-
isRememberMe
Indicates whether the passedAuthentication
token represents user that has been remembered (i.e. not a user that has been fully authenticated).The method is provided to assist with custom
AccessDecisionVoter
s and the like that you might develop. Of course, you don't need to use this method either and can develop your own "trust level" hierarchy instead.- Parameters:
authentication
- to test (may benull
in which case the method will always returnfalse
)- Returns:
true
the passed authentication token represented a principal authenticated using a remember-me token,false
otherwise
-
isFullyAuthenticated
Indicates whether the passedAuthentication
token represents a fully authenticated user (that is, neither anonymous or remember-me). This is a composition ofisAnonymous
andisRememberMe
implementation- Parameters:
authentication
- to test (may benull
in which case the method will always returnfalse
)- Returns:
true
the passed authentication token represented an authenticated user (isAuthenticated(Authentication)
and notisRememberMe(Authentication)
,false
otherwise- Since:
- 6.1
-
isAuthenticated
Checks if theAuthentication
is not null, authenticated, and not anonymous.- Parameters:
authentication
- theAuthentication
to check.- Returns:
- true if the
Authentication
is not null,isAnonymous(Authentication)
returns false, &Authentication.isAuthenticated()
is true. - Since:
- 6.1.7
-