|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.directory.server.core.authn.AbstractAuthenticator
org.apache.directory.server.core.authn.SimpleAuthenticator
public class SimpleAuthenticator
A simple Authenticator
that authenticates clear text passwords
contained within the userPassword
attribute in DIT. If the
password is stored with a one-way encryption applied (e.g. SHA), the password
is hashed the same way before comparison.
Constructor Summary | |
---|---|
SimpleAuthenticator()
Creates a new instance. |
Method Summary | |
---|---|
LdapPrincipal |
authenticate(org.apache.directory.shared.ldap.name.LdapDN principalDn,
ServerContext ctx)
Looks up userPassword attribute of the entry whose name is the value of Context.SECURITY_PRINCIPAL environment variable, and
authenticates a user with the plain-text password. |
protected java.lang.String |
createDigestedPassword(java.lang.String algorithm,
java.lang.Object password)
Creates a digested password. |
protected java.lang.String |
getAlgorithmForHashedPassword(java.lang.Object password)
Get the algorithm of a password, which is stored in the form "{XYZ}...". |
void |
invalidateCache(org.apache.directory.shared.ldap.name.LdapDN bindDn)
Does nothing leaving it so subclasses can override. |
protected boolean |
isPasswordOneWayEncrypted(java.lang.Object password)
Checks if the argument is one-way encryped. |
protected byte[] |
lookupUserPassword(org.apache.directory.shared.ldap.name.LdapDN principalDn)
|
Methods inherited from class org.apache.directory.server.core.authn.AbstractAuthenticator |
---|
createLdapPrincipal, destroy, doDestroy, doInit, getAuthenticatorType, getConfiguration, getFactoryConfiguration, init |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimpleAuthenticator()
Method Detail |
---|
public LdapPrincipal authenticate(org.apache.directory.shared.ldap.name.LdapDN principalDn, ServerContext ctx) throws javax.naming.NamingException
Context.SECURITY_PRINCIPAL
environment variable, and
authenticates a user with the plain-text password.
authenticate
in interface Authenticator
authenticate
in class AbstractAuthenticator
javax.naming.NamingException
protected byte[] lookupUserPassword(org.apache.directory.shared.ldap.name.LdapDN principalDn) throws javax.naming.NamingException
javax.naming.NamingException
protected boolean isPasswordOneWayEncrypted(java.lang.Object password)
password
- agument, either a string or a byte-array
protected java.lang.String getAlgorithmForHashedPassword(java.lang.Object password) throws java.lang.IllegalArgumentException
password,
- either a String or a byte[]
java.lang.IllegalArgumentException
protected java.lang.String createDigestedPassword(java.lang.String algorithm, java.lang.Object password) throws java.security.NoSuchAlgorithmException, java.lang.IllegalArgumentException
algorithm
- an algorithm which is supported by
java.security.MessageDigest, e.g. SHApassword
- password value, either a string or a byte[]
java.lang.IllegalArgumentException
- if password is neither a String nor a byte[], or algorithm is
not known to java.security.MessageDigest class
java.security.NoSuchAlgorithmException
public void invalidateCache(org.apache.directory.shared.ldap.name.LdapDN bindDn)
AbstractAuthenticator
invalidateCache
in interface Authenticator
invalidateCache
in class AbstractAuthenticator
bindDn
- the already normalized distinguished name of the bind principal
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |