public abstract class AbstractAuthenticator extends Object implements Authenticator
Modifier and Type | Field and Description |
---|---|
protected static org.slf4j.Logger |
LOG
A logger for the extending classes
|
Modifier | Constructor and Description |
---|---|
protected |
AbstractAuthenticator(org.apache.directory.api.ldap.model.constants.AuthenticationLevel type)
Creates a new instance.
|
protected |
AbstractAuthenticator(org.apache.directory.api.ldap.model.constants.AuthenticationLevel type,
org.apache.directory.api.ldap.model.name.Dn baseDn)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
checkPwdPolicy(org.apache.directory.api.ldap.model.entry.Entry userEntry)
performs checks on the given entry based on the specified password policy configuration
|
void |
destroy()
Calls
doDestroy() method, and clears default properties
(factoryConfiguration and configuration). |
protected void |
doDestroy()
Implement your deinitialization code here.
|
protected void |
doInit()
Implement your initialization code here.
|
org.apache.directory.api.ldap.model.constants.AuthenticationLevel |
getAuthenticatorType()
Returns the type of this authenticator (e.g.
|
org.apache.directory.api.ldap.model.name.Dn |
getBaseDn() |
DirectoryService |
getDirectoryService()
Returns
DirectoryService for this authenticator. |
void |
init(DirectoryService directoryService)
Initializes (directoryService and and calls
doInit() method. |
void |
invalidateCache(org.apache.directory.api.ldap.model.name.Dn bindDn)
Does nothing leaving it so subclasses can override.
|
boolean |
isValid(org.apache.directory.api.ldap.model.name.Dn bindDn)
Check that this selector is a valid one.
|
void |
setBaseDn(org.apache.directory.api.ldap.model.name.Dn baseDn)
Set the baseDN into the Authenticator
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
authenticate
protected static final org.slf4j.Logger LOG
protected AbstractAuthenticator(org.apache.directory.api.ldap.model.constants.AuthenticationLevel type)
type
- the type of this authenticator (e.g. 'simple', 'none'...)protected AbstractAuthenticator(org.apache.directory.api.ldap.model.constants.AuthenticationLevel type, org.apache.directory.api.ldap.model.name.Dn baseDn)
type
- the type of this authenticator (e.g. 'simple', 'none'...)baseDn
- The base DN for this authenticatorpublic DirectoryService getDirectoryService()
DirectoryService
for this authenticator.public org.apache.directory.api.ldap.model.constants.AuthenticationLevel getAuthenticatorType()
getAuthenticatorType
in interface Authenticator
public final void init(DirectoryService directoryService) throws org.apache.directory.api.ldap.model.exception.LdapException
doInit()
method.
Please put your initialization code into doInit()
.init
in interface Authenticator
directoryService
- the directory core for this authenticatororg.apache.directory.api.ldap.model.exception.LdapException
- if there is a problem starting up the authenticatorprotected void doInit()
public final void destroy()
doDestroy()
method, and clears default properties
(factoryConfiguration and configuration).
Please put your deinitialization code into doDestroy()
.destroy
in interface Authenticator
protected void doDestroy()
public void invalidateCache(org.apache.directory.api.ldap.model.name.Dn bindDn)
invalidateCache
in interface Authenticator
bindDn
- the already normalized distinguished name of the bind principalpublic boolean isValid(org.apache.directory.api.ldap.model.name.Dn bindDn)
isValid
in interface Authenticator
bindDn
- The DN we want to authenticatetrue
if the Auhenticator is supporting the DNpublic org.apache.directory.api.ldap.model.name.Dn getBaseDn()
getBaseDn
in interface Authenticator
public void setBaseDn(org.apache.directory.api.ldap.model.name.Dn baseDn)
setBaseDn
in interface Authenticator
baseDn
- The Base DN to setpublic void checkPwdPolicy(org.apache.directory.api.ldap.model.entry.Entry userEntry) throws org.apache.directory.api.ldap.model.exception.LdapException
checkPwdPolicy
in interface Authenticator
userEntry
- the user entry to be checked for authenticationorg.apache.directory.api.ldap.model.exception.LdapException
- If the password policy is incorrectCopyright © 2003–2020 The Apache Software Foundation. All rights reserved.