protected Principal createPrincipal ( final String username , final LdapEntry ldapEntry ) throws LoginException { LOGGER . debug ( "Creating LDAP principal for [{}] based on [{}] and attributes [{}]" , username , ldapEntry . getDn ( ) , ldapEntry . getAttributeNames ( ) ) ; val id = getLdapPrincipalIdentifier ( username , ldapEntry ) ; LOGGER . debug ( "LDAP principal identifier created is [{}]" , id ) ; val attributeMap = collectAttributesForLdapEntry ( ldapEntry , id ) ; LOGGER . debug ( "Created LDAP principal for id [{}] and [{}] attributes" , id , attributeMap . size ( ) ) ; return this . principalFactory . createPrincipal ( id , attributeMap ) ; }
Creates a CAS principal with attributes if the LDAP entry contains principal attributes .