Package org.ldaptive.auth
Class AggregateAuthenticationHandler
java.lang.Object
org.ldaptive.AbstractFreezable
org.ldaptive.auth.AggregateAuthenticationHandler
- All Implemented Interfaces:
AuthenticationHandler,Freezable
public final class AggregateAuthenticationHandler
extends AbstractFreezable
implements 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 final Map<String,AuthenticationHandler> Labeled authentication handlers.private final 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.voidfreeze()Freezes this object, making it immutable.Returns the authentication handlers to aggregate over.voidsetAuthenticationHandlers(Map<String, AuthenticationHandler> handlers) Sets the authentication handlers to aggregate over.Methods inherited from class org.ldaptive.AbstractFreezable
assertMutable, freeze, freeze, isFrozen
-
Field Details
-
logger
Logger 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
-
freeze
public void freeze()Description copied from interface:FreezableFreezes this object, making it immutable.- Specified by:
freezein interfaceFreezable- Overrides:
freezein classAbstractFreezable
-
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
-