Class CasUserDetailsService
java.lang.Object
org.springframework.security.cas.userdetails.AbstractCasAssertionUserDetailsService
org.jenkinsci.plugins.cas.spring.security.CasUserDetailsService
- All Implemented Interfaces:
org.springframework.security.core.userdetails.AuthenticationUserDetailsService<org.springframework.security.cas.authentication.CasAssertionAuthenticationToken>
public final class CasUserDetailsService
extends org.springframework.security.cas.userdetails.AbstractCasAssertionUserDetailsService
Populates the
GrantedAuthority
s for a user by reading a list of attributes that were returned as
part of the CAS response. Each attribute is read and each value of the attribute is turned into a GrantedAuthority. If the attribute has no
value then its not added.- Author:
- Scott Battaglia, Fabien Crespel
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet the attribute names used to extract granted authorities.Get default authorities to add to the user in any case.boolean
Converts the returned attribute values to uppercase values.protected org.springframework.security.core.userdetails.UserDetails
loadUserDetails
(org.apereo.cas.client.validation.Assertion assertion) void
setAttributes
(List<String> attributes) Set the attribute names used to extract granted authorities.void
setConvertToUpperCase
(boolean convertToUpperCase) Converts the returned attribute values to uppercase values.void
setDefaultAuthorities
(List<String> defaultAuthorities) Set default authorities to add to the user in any case.Methods inherited from class org.springframework.security.cas.userdetails.AbstractCasAssertionUserDetailsService
loadUserDetails
-
Field Details
-
NON_EXISTENT_PASSWORD_VALUE
- See Also:
-
-
Constructor Details
-
CasUserDetailsService
public CasUserDetailsService()
-
-
Method Details
-
loadUserDetails
protected org.springframework.security.core.userdetails.UserDetails loadUserDetails(org.apereo.cas.client.validation.Assertion assertion) - Specified by:
loadUserDetails
in classorg.springframework.security.cas.userdetails.AbstractCasAssertionUserDetailsService
-
getAttributes
Get the attribute names used to extract granted authorities.- Returns:
- the attributes
-
setAttributes
Set the attribute names used to extract granted authorities.- Parameters:
attributes
- the attributes to set
-
isConvertToUpperCase
public boolean isConvertToUpperCase()Converts the returned attribute values to uppercase values.- Returns:
- true if it should convert, false otherwise.
-
setConvertToUpperCase
public void setConvertToUpperCase(boolean convertToUpperCase) Converts the returned attribute values to uppercase values.- Parameters:
convertToUpperCase
- true if it should convert, false otherwise.
-
getDefaultAuthorities
Get default authorities to add to the user in any case.- Returns:
- default authorities
-
setDefaultAuthorities
Set default authorities to add to the user in any case.- Parameters:
defaultAuthorities
- default authorities
-