|
|||||||||||
| 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
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(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(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(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(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 Authenticatorauthenticate in class AbstractAuthenticatorjavax.naming.NamingException
protected byte[] lookupUserPassword(LdapDN principalDn)
throws javax.naming.NamingException
javax.naming.NamingExceptionprotected 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
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.NoSuchAlgorithmExceptionpublic void invalidateCache(LdapDN bindDn)
AbstractAuthenticator
invalidateCache in interface AuthenticatorinvalidateCache in class AbstractAuthenticator
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||