Class OAuthClientVoter
- java.lang.Object
-
- de.hybris.platform.ycommercewebservices.oauth2.OAuthClientVoter
-
- All Implemented Interfaces:
org.springframework.security.access.AccessDecisionVoter<java.lang.Object>
public class OAuthClientVoter extends java.lang.Object implements org.springframework.security.access.AccessDecisionVoter<java.lang.Object>Votes to grant access if current OAuth Client ID matches with any config attributeOnly 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
-
-
Constructor Summary
Constructors Constructor Description OAuthClientVoter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetClientPrefix()voidsetClientPrefix(java.lang.String clientPrefix)booleansupports(java.lang.Class<?> clazz)This 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, java.lang.Object object, java.util.Collection<org.springframework.security.access.ConfigAttribute> attributes)
-
-
-
Method Detail
-
getClientPrefix
public java.lang.String getClientPrefix()
-
setClientPrefix
public void setClientPrefix(java.lang.String clientPrefix)
-
supports
public boolean supports(org.springframework.security.access.ConfigAttribute attribute)
- Specified by:
supportsin interfaceorg.springframework.security.access.AccessDecisionVoter<java.lang.Object>
-
supports
public boolean supports(java.lang.Class<?> clazz)
This implementation supports any type of class, because it does not query the presented secure object.- Specified by:
supportsin interfaceorg.springframework.security.access.AccessDecisionVoter<java.lang.Object>- Parameters:
clazz- the secure object- Returns:
- always
true
-
vote
public int vote(org.springframework.security.core.Authentication authentication, java.lang.Object object, java.util.Collection<org.springframework.security.access.ConfigAttribute> attributes)- Specified by:
votein interfaceorg.springframework.security.access.AccessDecisionVoter<java.lang.Object>
-
-