Class LdapProfileService

  • All Implemented Interfaces:
    org.pac4j.core.credentials.authenticator.Authenticator, org.pac4j.core.profile.service.ProfileService<LdapProfile>

    public class LdapProfileService
    extends org.pac4j.core.profile.service.AbstractProfileService<LdapProfile>
    The LDAP profile service (which supersedes the LDAP authenticator). Notice that binary attributes are not supported.
    Since:
    2.0.0
    Author:
    Jerome Leleu
    • Field Summary

      • Fields inherited from class org.pac4j.core.profile.service.AbstractProfileService

        attributeNames, ID, LINKEDID, logger, SERIALIZED_PROFILE
    • Constructor Summary

      Constructors 
      Constructor Description
      LdapProfileService()  
      LdapProfileService​(org.ldaptive.auth.Authenticator ldapAuthenticator)  
      LdapProfileService​(org.ldaptive.auth.Authenticator ldapAuthenticator, java.lang.String attributes)  
      LdapProfileService​(org.ldaptive.ConnectionFactory connectionFactory, org.ldaptive.auth.Authenticator ldapAuthenticator, java.lang.String usersDn)  
      LdapProfileService​(org.ldaptive.ConnectionFactory connectionFactory, org.ldaptive.auth.Authenticator ldapAuthenticator, java.lang.String attributes, java.lang.String usersDn)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void deleteById​(java.lang.String id)  
      protected java.util.Map<java.lang.String,​java.lang.Object> getAttributesFromEntry​(org.ldaptive.LdapEntry entry)  
      org.ldaptive.ConnectionFactory getConnectionFactory()  
      protected java.lang.String getEntryId​(java.util.Map<java.lang.String,​java.lang.Object> attributes)  
      protected java.util.List<org.ldaptive.LdapAttribute> getLdapAttributes​(java.util.Map<java.lang.String,​java.lang.Object> attributes)  
      org.ldaptive.auth.Authenticator getLdapAuthenticator()  
      java.lang.String getUsersDn()  
      protected void insert​(java.util.Map<java.lang.String,​java.lang.Object> attributes)  
      protected void internalInit()  
      protected java.util.List<java.util.Map<java.lang.String,​java.lang.Object>> read​(java.util.List<java.lang.String> names, java.lang.String key, java.lang.String value)  
      void setConnectionFactory​(org.ldaptive.ConnectionFactory connectionFactory)  
      void setLdapAuthenticator​(org.ldaptive.auth.Authenticator ldapAuthenticator)  
      void setUsersDn​(java.lang.String usersDn)  
      java.lang.String toString()  
      protected void update​(java.util.Map<java.lang.String,​java.lang.Object> attributes)  
      void validate​(org.pac4j.core.credentials.Credentials cred, org.pac4j.core.context.WebContext context, org.pac4j.core.context.session.SessionStore sessionStore)  
      • Methods inherited from class org.pac4j.core.profile.service.AbstractProfileService

        convertAttributesToProfile, convertProfileAndPasswordToAttributes, create, defineAttributesToRead, findById, findByLinkedId, getAttributes, getIdAttribute, getPasswordAttribute, getPasswordEncoder, getSerializer, getUsernameAttribute, isLegacyMode, remove, removeById, setAttributes, setIdAttribute, setPasswordAttribute, setPasswordEncoder, setSerializer, setUsernameAttribute, update
      • Methods inherited from class org.pac4j.core.profile.definition.ProfileDefinitionAware

        defaultProfileDefinition, getProfileDefinition, setProfileDefinition
      • Methods inherited from class org.pac4j.core.util.InitializableObject

        afterInternalInit, beforeInternalInit, init, isInitialized
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • LdapProfileService

        public LdapProfileService()
      • LdapProfileService

        public LdapProfileService​(org.ldaptive.auth.Authenticator ldapAuthenticator)
      • LdapProfileService

        public LdapProfileService​(org.ldaptive.auth.Authenticator ldapAuthenticator,
                                  java.lang.String attributes)
      • LdapProfileService

        public LdapProfileService​(org.ldaptive.ConnectionFactory connectionFactory,
                                  org.ldaptive.auth.Authenticator ldapAuthenticator,
                                  java.lang.String usersDn)
      • LdapProfileService

        public LdapProfileService​(org.ldaptive.ConnectionFactory connectionFactory,
                                  org.ldaptive.auth.Authenticator ldapAuthenticator,
                                  java.lang.String attributes,
                                  java.lang.String usersDn)
    • Method Detail

      • internalInit

        protected void internalInit()
        Overrides:
        internalInit in class org.pac4j.core.profile.service.AbstractProfileService<LdapProfile>
      • insert

        protected void insert​(java.util.Map<java.lang.String,​java.lang.Object> attributes)
        Specified by:
        insert in class org.pac4j.core.profile.service.AbstractProfileService<LdapProfile>
      • getEntryId

        protected java.lang.String getEntryId​(java.util.Map<java.lang.String,​java.lang.Object> attributes)
      • getLdapAttributes

        protected java.util.List<org.ldaptive.LdapAttribute> getLdapAttributes​(java.util.Map<java.lang.String,​java.lang.Object> attributes)
      • update

        protected void update​(java.util.Map<java.lang.String,​java.lang.Object> attributes)
        Specified by:
        update in class org.pac4j.core.profile.service.AbstractProfileService<LdapProfile>
      • deleteById

        protected void deleteById​(java.lang.String id)
        Specified by:
        deleteById in class org.pac4j.core.profile.service.AbstractProfileService<LdapProfile>
      • read

        protected java.util.List<java.util.Map<java.lang.String,​java.lang.Object>> read​(java.util.List<java.lang.String> names,
                                                                                              java.lang.String key,
                                                                                              java.lang.String value)
        Specified by:
        read in class org.pac4j.core.profile.service.AbstractProfileService<LdapProfile>
      • getAttributesFromEntry

        protected java.util.Map<java.lang.String,​java.lang.Object> getAttributesFromEntry​(org.ldaptive.LdapEntry entry)
      • validate

        public void validate​(org.pac4j.core.credentials.Credentials cred,
                             org.pac4j.core.context.WebContext context,
                             org.pac4j.core.context.session.SessionStore sessionStore)
        Specified by:
        validate in interface org.pac4j.core.credentials.authenticator.Authenticator
        Overrides:
        validate in class org.pac4j.core.profile.service.AbstractProfileService<LdapProfile>
      • getConnectionFactory

        public org.ldaptive.ConnectionFactory getConnectionFactory()
      • setConnectionFactory

        public void setConnectionFactory​(org.ldaptive.ConnectionFactory connectionFactory)
      • getUsersDn

        public java.lang.String getUsersDn()
      • setUsersDn

        public void setUsersDn​(java.lang.String usersDn)
      • getLdapAuthenticator

        public org.ldaptive.auth.Authenticator getLdapAuthenticator()
      • setLdapAuthenticator

        public void setLdapAuthenticator​(org.ldaptive.auth.Authenticator ldapAuthenticator)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object