Class OAuthClientVoter
java.lang.Object
de.hybris.platform.ycommercewebservices.oauth2.OAuthClientVoter
- All Implemented Interfaces:
org.springframework.security.access.AccessDecisionVoter<Object>
public class OAuthClientVoter
extends Object
implements org.springframework.security.access.AccessDecisionVoter<Object>
Votes to grant access if current OAuth Client ID matches with any config attribute
Only config attributes starting with 'prefix' will be took into consideration. Default prefix is 'CLIENT_'. Prefix can be customized, in particular when null all config attributes will be analyzed.
If none of the configuration attributes starts with 'prefix', the voter abstains from voting.
If there are some configuration attributes starting with prefix but none matches, the voter denies access.
Comparisions are case insensitive.
Example: if config attribute = 'CLIENT_MOBILE_ANDROID' and client id is 'mobile_android' access by this voter is granted
-
Field Summary
Fields inherited from interface org.springframework.security.access.AccessDecisionVoter
ACCESS_ABSTAIN, ACCESS_DENIED, ACCESS_GRANTED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsetClientPrefix(String clientPrefix) booleanThis implementation supports any type of class, because it does not query the presented secure object.booleansupports(org.springframework.security.access.ConfigAttribute attribute) intvote(org.springframework.security.core.Authentication authentication, Object object, Collection<org.springframework.security.access.ConfigAttribute> attributes)
-
Constructor Details
-
OAuthClientVoter
public OAuthClientVoter()
-
-
Method Details
-
getClientPrefix
-
setClientPrefix
-
supports
public boolean supports(org.springframework.security.access.ConfigAttribute attribute) - Specified by:
supportsin interfaceorg.springframework.security.access.AccessDecisionVoter<Object>
-
supports
This implementation supports any type of class, because it does not query the presented secure object.- Specified by:
supportsin interfaceorg.springframework.security.access.AccessDecisionVoter<Object>- Parameters:
clazz- the secure object- Returns:
- always
true
-
vote
public int vote(org.springframework.security.core.Authentication authentication, Object object, Collection<org.springframework.security.access.ConfigAttribute> attributes) - Specified by:
votein interfaceorg.springframework.security.access.AccessDecisionVoter<Object>
-