Class LdapProfileService

java.lang.Object
org.pac4j.core.util.InitializableObject
org.pac4j.core.profile.definition.ProfileDefinitionAware
org.pac4j.core.profile.service.AbstractProfileService<LdapProfile>
org.pac4j.ldap.profile.service.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

    Fields inherited from interface org.pac4j.core.credentials.authenticator.Authenticator

    ALWAYS_VALIDATE
  • Constructor Summary

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

    Modifier and Type
    Method
    Description
    protected void
     
    protected Map<String,Object>
    getAttributesFromEntry(org.ldaptive.LdapEntry entry)
     
    protected String
    getEntryId(Map<String,Object> attributes)
     
    protected List<org.ldaptive.LdapAttribute>
     
    protected void
    insert(Map<String,Object> attributes)
     
    protected void
    internalInit(boolean forceReinit)
     
    protected List<Map<String,Object>>
    read(List<String> names, String key, String value)
     
    protected void
    update(Map<String,Object> attributes)
     
    Optional<org.pac4j.core.credentials.Credentials>
    validate(org.pac4j.core.context.CallContext ctx, org.pac4j.core.credentials.Credentials cred)
     

    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

    getProfileDefinition, setProfileDefinition, setProfileDefinitionIfUndefined

    Methods inherited from class org.pac4j.core.util.InitializableObject

    afterInternalInit, beforeInternalInit, getInitialized, getLastAttempt, getMaxAttempts, getMinTimeIntervalBetweenAttemptsInMilliseconds, getNbAttempts, init, init, isInitialized, reinit, setMaxAttempts, setMinTimeIntervalBetweenAttemptsInMilliseconds, shouldInitialize, toString

    Methods inherited from class java.lang.Object

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

    • LdapProfileService

      public LdapProfileService()
    • LdapProfileService

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

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

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

      public LdapProfileService(org.ldaptive.ConnectionFactory connectionFactory, org.ldaptive.auth.Authenticator ldapAuthenticator, String attributes, String usersDn)
  • Method Details

    • internalInit

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

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

      protected String getEntryId(Map<String,Object> attributes)
    • getLdapAttributes

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

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

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

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

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

      public Optional<org.pac4j.core.credentials.Credentials> validate(org.pac4j.core.context.CallContext ctx, org.pac4j.core.credentials.Credentials cred)
      Specified by:
      validate in interface org.pac4j.core.credentials.authenticator.Authenticator
      Overrides:
      validate in class org.pac4j.core.profile.service.AbstractProfileService<LdapProfile>