Package org.pac4j.ldap.profile.service
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, NEVER_VALIDATE
-
Constructor Summary
ConstructorDescriptionConstructor for LdapProfileService.LdapProfileService
(org.ldaptive.auth.Authenticator ldapAuthenticator) Constructor for LdapProfileService.LdapProfileService
(org.ldaptive.auth.Authenticator ldapAuthenticator, String attributes) Constructor for LdapProfileService.LdapProfileService
(org.ldaptive.ConnectionFactory connectionFactory, org.ldaptive.auth.Authenticator ldapAuthenticator, String usersDn) Constructor for LdapProfileService.LdapProfileService
(org.ldaptive.ConnectionFactory connectionFactory, org.ldaptive.auth.Authenticator ldapAuthenticator, String attributes, String usersDn) Constructor for LdapProfileService. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
deleteById
(String id) getAttributesFromEntry
(org.ldaptive.LdapEntry entry) getAttributesFromEntry.protected String
getEntryId
(Map<String, Object> attributes) getEntryId.protected List<org.ldaptive.LdapAttribute>
getLdapAttributes
(Map<String, Object> attributes) getLdapAttributes.protected void
protected void
internalInit
(boolean forceReinit) protected void
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
-
Constructor Details
-
LdapProfileService
public LdapProfileService()Constructor for LdapProfileService.
-
LdapProfileService
public LdapProfileService(org.ldaptive.auth.Authenticator ldapAuthenticator) Constructor for LdapProfileService.
- Parameters:
ldapAuthenticator
- aAuthenticator
object
-
LdapProfileService
Constructor for LdapProfileService.
- Parameters:
ldapAuthenticator
- aAuthenticator
objectattributes
- aString
object
-
LdapProfileService
public LdapProfileService(org.ldaptive.ConnectionFactory connectionFactory, org.ldaptive.auth.Authenticator ldapAuthenticator, String usersDn) Constructor for LdapProfileService.
- Parameters:
connectionFactory
- aConnectionFactory
objectldapAuthenticator
- aAuthenticator
objectusersDn
- aString
object
-
LdapProfileService
public LdapProfileService(org.ldaptive.ConnectionFactory connectionFactory, org.ldaptive.auth.Authenticator ldapAuthenticator, String attributes, String usersDn) Constructor for LdapProfileService.
-
-
Method Details
-
internalInit
protected void internalInit(boolean forceReinit) - Overrides:
internalInit
in classorg.pac4j.core.profile.service.AbstractProfileService<LdapProfile>
-
insert
- Specified by:
insert
in classorg.pac4j.core.profile.service.AbstractProfileService<LdapProfile>
-
getEntryId
getEntryId.
-
getLdapAttributes
getLdapAttributes.
-
update
- Specified by:
update
in classorg.pac4j.core.profile.service.AbstractProfileService<LdapProfile>
-
deleteById
- Specified by:
deleteById
in classorg.pac4j.core.profile.service.AbstractProfileService<LdapProfile>
-
read
- Specified by:
read
in classorg.pac4j.core.profile.service.AbstractProfileService<LdapProfile>
-
getAttributesFromEntry
getAttributesFromEntry.
- Parameters:
entry
- aLdapEntry
object- Returns:
- a
Map
object
-
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 interfaceorg.pac4j.core.credentials.authenticator.Authenticator
- Overrides:
validate
in classorg.pac4j.core.profile.service.AbstractProfileService<LdapProfile>
-