Package org.ldaptive.auth
Class AggregateAuthenticationHandler
java.lang.Object
org.ldaptive.auth.AggregateAuthenticationHandler
- All Implemented Interfaces:
AuthenticationHandler
Used in conjunction with an
AggregateDnResolver 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 -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Map<String,AuthenticationHandler> Labeled authentication handlers.protected final org.slf4j.LoggerLogger for this class. -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.Creates a new aggregate authentication handler. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAuthenticationHandler(String label, AuthenticationHandler handler) Adds an authentication handler with the supplied label.authenticate(AuthenticationCriteria criteria) Perform an ldap authentication.builder()Creates a builder for this class.Returns the authentication handlers to aggregate over.voidsetAuthenticationHandlers(Map<String, AuthenticationHandler> handlers) Sets the authentication handlers to aggregate over.
-
Field Details
-
logger
protected final org.slf4j.Logger loggerLogger for this class. -
authenticationHandlers
Labeled authentication handlers.
-
-
Constructor Details
-
AggregateAuthenticationHandler
public AggregateAuthenticationHandler()Default constructor. -
AggregateAuthenticationHandler
Creates a new aggregate authentication handler.- Parameters:
handlers- authentication handlers
-
-
Method Details
-
getAuthenticationHandlers
Returns the authentication handlers to aggregate over.- Returns:
- map of label to authentication handler
-
setAuthenticationHandlers
Sets the authentication handlers to aggregate over.- Parameters:
handlers- to set
-
addAuthenticationHandler
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:AuthenticationHandlerPerform an ldap authentication.- Specified by:
authenticatein interfaceAuthenticationHandler- Parameters:
criteria- to perform the authentication with- Returns:
- authentication handler response
- Throws:
LdapException- if ldap operation fails
-
builder
Creates a builder for this class.- Returns:
- new builder
-