public class

AuthenticatedVoter

extends Object
implements AccessDecisionVoter<S>
java.lang.Object
   ↳ org.springframework.security.access.vote.AuthenticatedVoter

Class Overview

Votes if a getAttribute() of IS_AUTHENTICATED_FULLY or IS_AUTHENTICATED_REMEMBERED or IS_AUTHENTICATED_ANONYMOUSLY is present. This list is in order of most strict checking to least strict checking.

The current Authentication will be inspected to determine if the principal has a particular level of authentication. The "FULLY" authenticated option means the user is authenticated fully (i.e. isAnonymous(Authentication) is false and isRememberMe(Authentication) is false). The "REMEMBERED" will grant access if the principal was either authenticated via remember-me OR is fully authenticated. The "ANONYMOUSLY" will grant access if the principal was authenticated via remember-me, OR anonymously, OR via full authentication.

All comparisons and prefixes are case sensitive.

Summary

Constants
String IS_AUTHENTICATED_ANONYMOUSLY
String IS_AUTHENTICATED_FULLY
String IS_AUTHENTICATED_REMEMBERED
[Expand]
Inherited Constants
From interface org.springframework.security.access.AccessDecisionVoter
Public Constructors
AuthenticatedVoter()
Public Methods
void setAuthenticationTrustResolver(AuthenticationTrustResolver authenticationTrustResolver)
boolean supports(Class<?> clazz)
This implementation supports any type of class, because it does not query the presented secure object.
boolean supports(ConfigAttribute attribute)
Indicates whether this AccessDecisionVoter is able to vote on the passed ConfigAttribute.
int vote(Authentication authentication, Object object, Collection<ConfigAttribute> attributes)
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.springframework.security.access.AccessDecisionVoter

Constants

public static final String IS_AUTHENTICATED_ANONYMOUSLY

Constant Value: "IS_AUTHENTICATED_ANONYMOUSLY"

public static final String IS_AUTHENTICATED_FULLY

Constant Value: "IS_AUTHENTICATED_FULLY"

public static final String IS_AUTHENTICATED_REMEMBERED

Constant Value: "IS_AUTHENTICATED_REMEMBERED"

Public Constructors

public AuthenticatedVoter ()

Public Methods

public void setAuthenticationTrustResolver (AuthenticationTrustResolver authenticationTrustResolver)

public boolean supports (Class<?> clazz)

This implementation supports any type of class, because it does not query the presented secure object.

Parameters
clazz the secure object type
Returns
  • always true

public boolean supports (ConfigAttribute attribute)

Indicates whether this AccessDecisionVoter is able to vote on the passed ConfigAttribute.

This allows the AbstractSecurityInterceptor to check every configuration attribute can be consumed by the configured AccessDecisionManager and/or RunAsManager and/or AfterInvocationManager.

Parameters
attribute a configuration attribute that has been configured against the AbstractSecurityInterceptor
Returns
  • true if this AccessDecisionVoter can support the passed configuration attribute

public int vote (Authentication authentication, Object object, Collection<ConfigAttribute> attributes)