Package org.ldaptive.auth.ext
Class ActiveDirectoryAuthenticationResponseHandler
java.lang.Object
org.ldaptive.AbstractFreezable
org.ldaptive.auth.ext.ActiveDirectoryAuthenticationResponseHandler
- All Implemented Interfaces:
AuthenticationResponseHandler,Freezable
public class ActiveDirectoryAuthenticationResponseHandler
extends AbstractFreezable
implements AuthenticationResponseHandler
Attempts to parse the authentication response message and set the account state using data associated with active
directory. If this handler is assigned a
expirationPeriod, then the Authenticator
should be configured to return the 'pwdLastSet' attribute, so it can be consumed by this handler. This will cause the
handler to emit a warning for the pwdLastSet value plus the expiration amount. The scope of that warning can be
further narrowed by providing a warningPeriod. By default, if the msDS-UserPasswordExpiryTimeComputed
attribute is found, expirationPeriod is ignored.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String[]Attributes needed to enforce password policy.private final ClockClock to calculate current date for comparison with expiration time.private PeriodAmount of time since a password was set until it will expire.private final LoggerLogger for this class.private PeriodAmount of time before expiration to produce a warning. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new active directory authentication response handler.Creates a new active directory authentication response handler.Creates a new active directory authentication response handler.ActiveDirectoryAuthenticationResponseHandler(Period expiration, Period warning) Creates a new active directory authentication response handler. -
Method Summary
Modifier and TypeMethodDescriptionReturns the amount of time since a password was set until it will expire.Returns the amount of time before expiration to produce a warning.voidhandle(AuthenticationResponse response) Handle the response from an ldap authentication.voidsetExpirationPeriod(Period period) Sets amount of time since a password was set until it will expire.voidsetWarningPeriod(Period period) Sets the amount of time before expiration to produce a warning.toString()Methods inherited from class org.ldaptive.AbstractFreezable
assertMutable, freeze, freeze, freeze, isFrozen
-
Field Details
-
ATTRIBUTES
Attributes needed to enforce password policy. -
logger
Logger for this class. -
expirationClock
Clock to calculate current date for comparison with expiration time. -
expirationPeriod
Amount of time since a password was set until it will expire. Used if msDS-UserPasswordExpiryTimeComputed cannot be read. -
warningPeriod
Amount of time before expiration to produce a warning.
-
-
Constructor Details
-
ActiveDirectoryAuthenticationResponseHandler
ActiveDirectoryAuthenticationResponseHandler(Clock clock) Creates a new active directory authentication response handler.- Parameters:
clock- used to convert time before expiration to a datetime
-
ActiveDirectoryAuthenticationResponseHandler
public ActiveDirectoryAuthenticationResponseHandler()Creates a new active directory authentication response handler. -
ActiveDirectoryAuthenticationResponseHandler
Creates a new active directory authentication response handler.- Parameters:
warning- length of time before expiration that should produce a warning
-
ActiveDirectoryAuthenticationResponseHandler
Creates a new active directory authentication response handler.- Parameters:
expiration- length of time that a password is validwarning- length of time before expiration that should produce a warning
-
-
Method Details
-
handle
Description copied from interface:AuthenticationResponseHandlerHandle the response from an ldap authentication.- Specified by:
handlein interfaceAuthenticationResponseHandler- Parameters:
response- produced from an authentication
-
getExpirationPeriod
Returns the amount of time since a password was set until it will expire.- Returns:
- expiration period
-
setExpirationPeriod
Sets amount of time since a password was set until it will expire.- Parameters:
period- expiration period
-
getWarningPeriod
Returns the amount of time before expiration to produce a warning.- Returns:
- warning period
-
setWarningPeriod
Sets the amount of time before expiration to produce a warning.- Parameters:
period- warning period
-
toString
-