Package org.ldaptive.auth.ext
Class ActiveDirectoryAuthenticationResponseHandler
- java.lang.Object
-
- org.ldaptive.auth.ext.ActiveDirectoryAuthenticationResponseHandler
-
- All Implemented Interfaces:
AuthenticationResponseHandler
public class ActiveDirectoryAuthenticationResponseHandler extends java.lang.Object 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 aexpirationPeriod, then theAuthenticatorshould 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 awarningPeriod. By default if the msDS-UserPasswordExpiryTimeComputed attribute is found, expirationPeriod is ignored.- Author:
- Middleware Services
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String[]ATTRIBUTESAttributes needed to enforce password policy.
-
Constructor Summary
Constructors Constructor Description ActiveDirectoryAuthenticationResponseHandler()Default constructor.ActiveDirectoryAuthenticationResponseHandler(java.time.Period warning)Creates a new active directory authentication response handler.ActiveDirectoryAuthenticationResponseHandler(java.time.Period expiration, java.time.Period warning)Creates a new active directory authentication response handler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.time.PeriodgetExpirationPeriod()Returns the amount of time since a password was set until it will expire.java.time.PeriodgetWarningPeriod()Returns the amount of time before expiration to produce a warning.voidhandle(AuthenticationResponse response)Handle the response from an ldap authentication.voidsetExpirationPeriod(java.time.Period period)Sets amount of time since a password was set until it will expire.voidsetWarningPeriod(java.time.Period period)Sets the amount of time before expiration to produce a warning.java.lang.StringtoString()
-
-
-
Constructor Detail
-
ActiveDirectoryAuthenticationResponseHandler
public ActiveDirectoryAuthenticationResponseHandler()
Default constructor.
-
ActiveDirectoryAuthenticationResponseHandler
public ActiveDirectoryAuthenticationResponseHandler(java.time.Period warning)
Creates a new active directory authentication response handler.- Parameters:
warning- length of time before expiration that should produce a warning
-
ActiveDirectoryAuthenticationResponseHandler
public ActiveDirectoryAuthenticationResponseHandler(java.time.Period expiration, java.time.Period warning)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 Detail
-
handle
public void handle(AuthenticationResponse response)
Description copied from interface:AuthenticationResponseHandlerHandle the response from an ldap authentication.- Specified by:
handlein interfaceAuthenticationResponseHandler- Parameters:
response- produced from an authentication
-
getExpirationPeriod
public java.time.Period getExpirationPeriod()
Returns the amount of time since a password was set until it will expire.- Returns:
- expiration period
-
setExpirationPeriod
public void setExpirationPeriod(java.time.Period period)
Sets amount of time since a password was set until it will expire.- Parameters:
period- expiration period
-
getWarningPeriod
public java.time.Period getWarningPeriod()
Returns the amount of time before expiration to produce a warning.- Returns:
- warning period
-
setWarningPeriod
public void setWarningPeriod(java.time.Period period)
Sets the amount of time before expiration to produce a warning.- Parameters:
period- warning period
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-