Package org.springframework.security.cas.userdetails

# Class GrantedAuthorityFromAssertionAttributesUserDetailsService

java.lang.Object
org.springframework.security.cas.userdetails.AbstractCasAssertionUserDetailsService
org.springframework.security.cas.userdetails.GrantedAuthorityFromAssertionAttributesUserDetailsService

All Implemented Interfaces:
  `org.springframework.security.core.userdetails.AuthenticationUserDetailsService<CasAssertionAuthenticationToken>`

public final class GrantedAuthorityFromAssertionAttributesUserDetailsService extends 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.

Since:
  3.0

## Constructor Summary

Constructors
Constructor
Description
`GrantedAuthorityFromAssertionAttributesUserDetailsService(String[] attributes)`

## Method Summary

Modifier and Type
Method
Description
`protected org.springframework.security.core.userdetails.UserDetails`
`loadUserDetails(org.apereo.cas.client.validation.Assertion assertion)`
Protected template method for construct a `UserDetails` via the supplied CAS assertion.
`void`
`setConvertToUpperCase(boolean convertToUpperCase)`
Converts the returned attribute values to uppercase values.

### Methods inherited from class org.springframework.security.cas.userdetails.AbstractCasAssertionUserDetailsService

`loadUserDetails`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### GrantedAuthorityFromAssertionAttributesUserDetailsService

public GrantedAuthorityFromAssertionAttributesUserDetailsService(String[] attributes)

## Method Details

### loadUserDetails

protected org.springframework.security.core.userdetails.UserDetails loadUserDetails(org.apereo.cas.client.validation.Assertion assertion)
Description copied from class: `AbstractCasAssertionUserDetailsService`
Protected template method for construct a `UserDetails` via the supplied CAS assertion.

Specified by:
  `loadUserDetails` in class `AbstractCasAssertionUserDetailsService`
Parameters:
  `assertion` - the assertion to use to construct the new UserDetails. CANNOT be NULL.
Returns:
  the newly constructed UserDetails.

### setConvertToUpperCase

public void setConvertToUpperCase(boolean convertToUpperCase)
Converts the returned attribute values to uppercase values.

Parameters:
  `convertToUpperCase` - true if it should convert, false otherwise.