Class 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 Detail

      • PrincipalAttributeRegisteredServiceUsernameProvider

        public PrincipalAttributeRegisteredServiceUsernameProvider​(java.lang.String usernameAttribute,
                                                                   java.lang.String canonicalizationMode)
    • 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 class BaseRegisteredServiceUsernameAttributeProvider
        Parameters:
        principal - the principal
        service - the service
        registeredService - 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 principal,
                                                                                                                                 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:
        principal - the principal
        service - the service
        registeredService - the registered service
        Returns:
        the principal attributes