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 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.private 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.void
freeze()
Freezes this object, making it immutable.Map<String,AuthenticationHandler>
getAuthenticationHandlers()
Returns the authentication handlers to aggregate over.void
setAuthenticationHandlers(Map<String,AuthenticationHandler> handlers)
Sets the authentication handlers to aggregate over.-
Methods inherited from class org.ldaptive.AbstractFreezable
assertMutable, freeze, freeze, isFrozen
-
-
-
-
Field Detail
-
logger
private final Logger logger
Logger for this class.
-
authenticationHandlers
private final 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
-
freeze
public void freeze()
Description copied from interface:Freezable
Freezes this object, making it immutable.- Specified by:
freeze
in interfaceFreezable
- Overrides:
freeze
in classAbstractFreezable
-
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
-
-