Package org.ldaptive.auth
Class AggregateAuthenticationHandler
- java.lang.Object
-
- org.ldaptive.auth.AggregateAuthenticationHandler
-
- All Implemented Interfaces:
AuthenticationHandler
public class AggregateAuthenticationHandler extends Object implements AuthenticationHandler
Used in conjunction with anAggregateDnResolver
to authenticate the resolved DN. In particular, the resolved DN is expected to be of the form: label:DN where the label indicates the authentication handler to use. This class only invokes one authentication handler that matches the label found on the DN.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AggregateAuthenticationHandler.Builder
-
Field Summary
Fields Modifier and Type Field Description private Map<String,AuthenticationHandler>
authenticationHandlers
Labeled authentication handlers.protected Logger
logger
Logger for this class.
-
Constructor Summary
Constructors Constructor Description AggregateAuthenticationHandler()
Default constructor.AggregateAuthenticationHandler(Map<String,AuthenticationHandler> handlers)
Creates a new aggregate authentication handler.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAuthenticationHandler(String label, AuthenticationHandler handler)
Adds an authentication handler with the supplied label.AuthenticationHandlerResponse
authenticate(AuthenticationCriteria criteria)
Perform an ldap authentication.static AggregateAuthenticationHandler.Builder
builder()
Creates a builder for this class.Map<String,AuthenticationHandler>
getAuthenticationHandlers()
Returns the authentication handlers to aggregate over.void
setAuthenticationHandlers(Map<String,AuthenticationHandler> handlers)
Sets the authentication handlers to aggregate over.
-
-
-
Field Detail
-
logger
protected final Logger logger
Logger for this class.
-
authenticationHandlers
private Map<String,AuthenticationHandler> authenticationHandlers
Labeled authentication handlers.
-
-
Constructor Detail
-
AggregateAuthenticationHandler
public AggregateAuthenticationHandler()
Default constructor.
-
AggregateAuthenticationHandler
public AggregateAuthenticationHandler(Map<String,AuthenticationHandler> handlers)
Creates a new aggregate authentication handler.- Parameters:
handlers
- authentication handlers
-
-
Method Detail
-
getAuthenticationHandlers
public Map<String,AuthenticationHandler> getAuthenticationHandlers()
Returns the authentication handlers to aggregate over.- Returns:
- map of label to authentication handler
-
setAuthenticationHandlers
public void setAuthenticationHandlers(Map<String,AuthenticationHandler> handlers)
Sets the authentication handlers to aggregate over.- Parameters:
handlers
- to set
-
addAuthenticationHandler
public void addAuthenticationHandler(String label, AuthenticationHandler handler)
Adds an authentication handler with the supplied label.- Parameters:
label
- of the resolverhandler
- authentication handler
-
authenticate
public AuthenticationHandlerResponse authenticate(AuthenticationCriteria criteria) throws LdapException
Description copied from interface:AuthenticationHandler
Perform an ldap authentication.- Specified by:
authenticate
in interfaceAuthenticationHandler
- Parameters:
criteria
- to perform the authentication with- Returns:
- authentication handler response
- Throws:
LdapException
- if ldap operation fails
-
builder
public static AggregateAuthenticationHandler.Builder builder()
Creates a builder for this class.- Returns:
- new builder
-
-