Class PasswordPolicyResponseControl
java.lang.Object
org.springframework.security.ldap.ppolicy.PasswordPolicyControl
org.springframework.security.ldap.ppolicy.PasswordPolicyResponseControl
- All Implemented Interfaces:
Serializable
,Control
Represents the response control received when a PasswordPolicyControl is used
when binding to a directory. Currently tested with the OpenLDAP 2.3.19 implementation
of the LDAP Password Policy Draft. It extends the request control with the control
specific data. This is accomplished by the properties timeBeforeExpiration,
graceLoginsRemaining.
-
Field Summary
Fields inherited from class org.springframework.security.ldap.ppolicy.PasswordPolicyControl
OID
Fields inherited from interface javax.naming.ldap.Control
CRITICAL, NONCRITICAL
-
Constructor Summary
ConstructorDescriptionPasswordPolicyResponseControl
(byte[] encodedValue) Decodes the Ber encoded control data. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
Returns the unchanged value of the response control.int
Returns the graceLoginsRemaining.int
Returns the timeBeforeExpiration.boolean
hasError()
Checks whether an error is present.boolean
Checks whether a warning is present.boolean
boolean
boolean
isLocked()
Determines whether an account locked error has been returned.boolean
toString()
Create a textual representation containing error and warning messages, if any are present.Methods inherited from class org.springframework.security.ldap.ppolicy.PasswordPolicyControl
getID, isCritical
-
Constructor Details
-
PasswordPolicyResponseControl
public PasswordPolicyResponseControl(byte[] encodedValue) Decodes the Ber encoded control data. The ASN.1 value of the control data is:PasswordPolicyResponseValue ::= SEQUENCE { warning [0] CHOICE { timeBeforeExpiration [0] INTEGER (0 .. maxInt), graceAuthNsRemaining [1] INTEGER (0 .. maxInt) } OPTIONAL, error [1] ENUMERATED { passwordExpired (0), accountLocked (1), changeAfterReset (2), passwordModNotAllowed (3), mustSupplyOldPassword (4), insufficientPasswordQuality (5), passwordTooShort (6), passwordTooYoung (7), passwordInHistory (8) } OPTIONAL }
-
-
Method Details
-
getEncodedValue
public byte[] getEncodedValue()Returns the unchanged value of the response control. Returns the unchanged value of the response control as byte array.- Specified by:
getEncodedValue
in interfaceControl
- Overrides:
getEncodedValue
in classPasswordPolicyControl
- Returns:
- always null
-
getErrorStatus
-
getGraceLoginsRemaining
public int getGraceLoginsRemaining()Returns the graceLoginsRemaining.- Returns:
- Returns the graceLoginsRemaining.
-
getTimeBeforeExpiration
public int getTimeBeforeExpiration()Returns the timeBeforeExpiration.- Returns:
- Returns the time before expiration in seconds
-
hasError
public boolean hasError()Checks whether an error is present.- Returns:
- true, if an error is present
-
hasWarning
public boolean hasWarning()Checks whether a warning is present.- Returns:
- true, if a warning is present
-
isExpired
public boolean isExpired() -
isChangeAfterReset
public boolean isChangeAfterReset() -
isUsingGraceLogins
public boolean isUsingGraceLogins() -
isLocked
public boolean isLocked()Determines whether an account locked error has been returned.- Returns:
- true if the account is locked.
-
toString
Create a textual representation containing error and warning messages, if any are present.
-