|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ldaptive.auth.Authenticator
public class Authenticator
Provides functionality to authenticate users against an ldap directory.
| Field Summary | |
|---|---|
protected org.slf4j.Logger |
logger
Logger for this class. |
| Constructor Summary | |
|---|---|
Authenticator()
Default constructor. |
|
Authenticator(DnResolver resolver,
AuthenticationHandler handler)
Creates a new authenticator. |
|
| Method Summary | |
|---|---|
AuthenticationResponse |
authenticate(AuthenticationRequest request)
Authenticate the user in the supplied request. |
protected AuthenticationResponse |
authenticate(String dn,
AuthenticationRequest request)
Performs authentication by opening a new connection to the LDAP and binding as the supplied DN. |
AuthenticationHandler |
getAuthenticationHandler()
Returns the authentication handler. |
AuthenticationRequestHandler[] |
getAuthenticationRequestHandlers()
Returns the authentication request handlers. |
AuthenticationResponseHandler[] |
getAuthenticationResponseHandlers()
Returns the authentication response handlers. |
DnResolver |
getDnResolver()
Returns the DN resolver. |
EntryResolver |
getEntryResolver()
Returns the entry resolver. |
boolean |
getResolveEntryOnFailure()
Returns whether to execute the entry resolver on authentication failure. |
protected AuthenticationRequest |
processRequest(String dn,
AuthenticationRequest request)
Creates a new authentication request applying any applicable configuration on this authenticator. |
String |
resolveDn(String user)
This will attempt to find the DN for the supplied user. |
String |
resolveDn(User user)
This will attempt to find the DN for the supplied user. |
protected LdapEntry |
resolveEntry(AuthenticationRequest request,
AuthenticationHandlerResponse response,
AuthenticationCriteria criteria)
Attempts to find the ldap entry for the supplied DN. |
void |
setAuthenticationHandler(AuthenticationHandler handler)
Sets the authentication handler. |
void |
setAuthenticationRequestHandlers(AuthenticationRequestHandler... handlers)
Sets the authentication request handlers. |
void |
setAuthenticationResponseHandlers(AuthenticationResponseHandler... handlers)
Sets the authentication response handlers. |
void |
setDnResolver(DnResolver resolver)
Sets the DN resolver. |
void |
setEntryResolver(EntryResolver resolver)
Sets the entry resolver. |
void |
setResolveEntryOnFailure(boolean b)
Sets whether to execute the entry resolver on authentication failure. |
String |
toString()
|
protected AuthenticationResponse |
validateInput(String dn,
AuthenticationRequest request)
Validates the authentication request and resolved DN. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final org.slf4j.Logger logger
| Constructor Detail |
|---|
public Authenticator()
public Authenticator(DnResolver resolver,
AuthenticationHandler handler)
resolver - dn resolverhandler - authentication handler| Method Detail |
|---|
public DnResolver getDnResolver()
public void setDnResolver(DnResolver resolver)
resolver - for finding DNspublic AuthenticationHandler getAuthenticationHandler()
public void setAuthenticationHandler(AuthenticationHandler handler)
handler - for performing authenticationpublic EntryResolver getEntryResolver()
public void setEntryResolver(EntryResolver resolver)
resolver - for finding entriespublic boolean getResolveEntryOnFailure()
public void setResolveEntryOnFailure(boolean b)
b - whether to execute the entry resolverpublic AuthenticationRequestHandler[] getAuthenticationRequestHandlers()
public void setAuthenticationRequestHandlers(AuthenticationRequestHandler... handlers)
handlers - authentication request handlerspublic AuthenticationResponseHandler[] getAuthenticationResponseHandlers()
public void setAuthenticationResponseHandlers(AuthenticationResponseHandler... handlers)
handlers - authentication response handlers
public String resolveDn(String user)
throws LdapException
DnResolver.resolve(String) is invoked to perform this operation.
user - to find DN for
LdapException - if an LDAP error occurs during resolution
public String resolveDn(User user)
throws LdapException
DnResolverEx.resolve(User) is invoked to perform this operation.
user - to find DN for
LdapException - if an LDAP error occurs during resolution
public AuthenticationResponse authenticate(AuthenticationRequest request)
throws LdapException
request - authentication request
LdapException - if an LDAP error occurs
protected AuthenticationResponse authenticate(String dn,
AuthenticationRequest request)
throws LdapException
dn - to authenticate asrequest - containing authentication parameters
LdapException - if an LDAP error occurs
protected AuthenticationResponse validateInput(String dn,
AuthenticationRequest request)
dn - to validaterequest - to validate
protected AuthenticationRequest processRequest(String dn,
AuthenticationRequest request)
throws LdapException
dn - to processrequest - to process
LdapException - if an error occurs with a request handler
protected LdapEntry resolveEntry(AuthenticationRequest request,
AuthenticationHandlerResponse response,
AuthenticationCriteria criteria)
throws LdapException
SearchEntryResolver is used if
return attributes have been requested. If none of these criteria is met, a
NoOpDnResolver is used.
request - authentication requestresponse - from the authentication handlercriteria - needed by the entry resolver
LdapException - if an error occurs resolving the entrypublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||