Package org.apereo.cas.services
Class PrincipalAttributeRegisteredServiceUsernameProvider
- java.lang.Object
-
- org.apereo.cas.services.BaseRegisteredServiceUsernameAttributeProvider
-
- org.apereo.cas.services.PrincipalAttributeRegisteredServiceUsernameProvider
-
- All Implemented Interfaces:
java.io.Serializable
,org.apereo.cas.services.RegisteredServiceUsernameAttributeProvider
public class PrincipalAttributeRegisteredServiceUsernameProvider extends BaseRegisteredServiceUsernameAttributeProvider
Determines the username for this registered service based on a principal attribute. If the attribute is not found, default principal id is returned.- Since:
- 4.1.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PrincipalAttributeRegisteredServiceUsernameProvider(java.lang.String usernameAttribute, java.lang.String canonicalizationMode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.Map<java.lang.String,java.util.List<java.lang.Object>>
getPrincipalAttributesFromReleasePolicy(org.apereo.cas.authentication.principal.Principal p, org.apereo.cas.authentication.principal.Service service, org.apereo.cas.services.RegisteredService registeredService)
Gets principal attributes.java.lang.String
resolveUsernameInternal(org.apereo.cas.authentication.principal.Principal principal, org.apereo.cas.authentication.principal.Service service, org.apereo.cas.services.RegisteredService registeredService)
Resolve username internal string.-
Methods inherited from class org.apereo.cas.services.BaseRegisteredServiceUsernameAttributeProvider
encryptResolvedUsername, initialize, resolveUsername
-
-
-
-
Method Detail
-
resolveUsernameInternal
public java.lang.String resolveUsernameInternal(org.apereo.cas.authentication.principal.Principal principal, org.apereo.cas.authentication.principal.Service service, org.apereo.cas.services.RegisteredService registeredService)
Description copied from class:BaseRegisteredServiceUsernameAttributeProvider
Resolve username internal string.- Specified by:
resolveUsernameInternal
in classBaseRegisteredServiceUsernameAttributeProvider
- Parameters:
principal
- the principalservice
- the serviceregisteredService
- the registered service- Returns:
- the string
-
getPrincipalAttributesFromReleasePolicy
protected java.util.Map<java.lang.String,java.util.List<java.lang.Object>> getPrincipalAttributesFromReleasePolicy(org.apereo.cas.authentication.principal.Principal p, org.apereo.cas.authentication.principal.Service service, org.apereo.cas.services.RegisteredService registeredService)
Gets principal attributes. Will attempt to locate the principal attribute repository from the context if one is defined to use that instance to locate attributes. If none is available, will use the default principal attributes.- Parameters:
p
- the principalservice
- the serviceregisteredService
- the registered service- Returns:
- the principal attributes
-
-