| Modifier and Type | Class and Description |
|---|---|
| protected static class |
| Modifier and Type | Field and Description |
|---|---|
| protected int | cacheRemovalWarningTime
If a failed user is removed from the cache because the cache is too big before it has been in the cache for at least this period of time (in seconds) a warning message will be logged. |
| protected int | cacheSize
Number of users that have failed authentication to keep in cache. |
| protected Map | failedUsers
Users whose last authentication attempt failed. |
| protected int | failureCount
The number of times in a row a user has to fail authentication to be locked out. |
| protected int | lockOutTime
The time (in seconds) a user is locked out for after too many authentication failures. |
| private static final Log |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Principal | authenticate(String
Username of the Principal to look up username, String Digest which has been submitted by the client clientDigest, String Unique (or supposedly unique) token which has been used
for this request nonce, String the nonce counter nc, String the client chosen nonce cnonce, String the "quality of protection" ( qop, String nc and cnonce
will only be used, if qop is not null).Realm name realmName, String Second digest calculated as digest(Method + ":" + uri) digestA2, String The message digest algorithm to use algorithm)Overrides org. Overrides default org. Try to authenticate with the specified username, which matches the digest calculated using the given parameters using the method described in RFC 7616. |
| public Principal | authenticate(String
Username of the Principal to look up username, String Password or other credentials to use in
authenticating this username credentials)Overrides org. Implements org. Try to authenticate using the specified username and credentials. |
| public Principal | authenticate(X509Certificate[]
Array of client certificates, with the first one in
the array being the certificate of the client itself. certs)Overrides org. Implements org. Try to authenticate using a chain of |
| public Principal | authenticate(GSSContext
The gssContext processed by the gssContext, boolean Authenticator.Should the realm attempt to store the delegated
credentials in the returned Principal? storeCreds)Overrides org. Implements org. Try to authenticate using a |
| public Principal | authenticate(GSSName
The gssName, GSSCredential GSSName of the principal to look upThe gssCredential)GSSCredential of the principal, may be
nullOverrides org. Implements org. Try to authenticate using a |
| private Principal | |
| public int | Returns: the cacheRemovalWarningTimeGet the minimum period a failed authentication must remain in the cache to avoid generating a warning if it is removed from the cache to make space for a new entry. |
| public int | Returns: the cacheSizeGet the maximum number of users for which authentication failure will be kept in the cache. |
| public int | Returns: the failureCountGet the number of failed authentication attempts required to lock the user account. |
| public int | |
| public boolean | |
| private void | |
| private synchronized void | |
| public void | setCacheRemovalWarningTime(int
the cacheRemovalWarningTime to set cacheRemovalWarningTime)Set the minimum period a failed authentication must remain in the cache to avoid generating a warning if it is removed from the cache to make space for a new entry. |
| public void | setCacheSize(int
the cacheSize to set cacheSize)Set the maximum number of users for which authentication failure will be kept in the cache. |
| public void | setFailureCount(int
the failureCount to set failureCount)Set the number of failed authentication attempts required to lock the user account. |
| public void | setLockOutTime(int
the lockOutTime to set lockOutTime)Set the period for which an account will be locked. |
| protected void | startInternal()
Overrides org. Prepare for the beginning of active use of the public methods of this component and implement the requirements of
|
| public void |
| cacheRemovalWarningTime | back to summary |
|---|---|
| protected int cacheRemovalWarningTime If a failed user is removed from the cache because the cache is too big before it has been in the cache for at least this period of time (in seconds) a warning message will be logged. Defaults to 3600 (1 hour). | |
| cacheSize | back to summary |
|---|---|
| protected int cacheSize Number of users that have failed authentication to keep in cache. Over time the cache will grow to this size and may not shrink. Defaults to 1000. | |
| failedUsers | back to summary |
|---|---|
| protected Map<String, LockOutRealm. Users whose last authentication attempt failed. Entries will be ordered in access order from least recent to most recent. | |
| failureCount | back to summary |
|---|---|
| protected int failureCount The number of times in a row a user has to fail authentication to be locked out. Defaults to 5. | |
| lockOutTime | back to summary |
|---|---|
| protected int lockOutTime The time (in seconds) a user is locked out for after too many authentication failures. Defaults to 300 (5 minutes). | |
| log | back to summary |
|---|---|
| private static final Log log | |
| LockOutRealm | back to summary |
|---|---|
| public LockOutRealm() | |
| authenticate | back to summary |
|---|---|
| public Principal authenticate(String username, String clientDigest, String nonce, String nc, String cnonce, String qop, String realmName, String digestA2, String algorithm) Overrides org. Overrides default org. Doc from org. Try to authenticate with the specified username, which matches the digest calculated using the given parameters using the method described in RFC 7616.
The default implementation calls Implementations are expected to override the default implementation and take account of the algorithm parameter.
| |
| authenticate | back to summary |
|---|---|
| public Principal authenticate(String username, String credentials) Overrides org. Implements org. Doc from org. Try to authenticate using the specified username and credentials. | |
| authenticate | back to summary |
|---|---|
| public Principal authenticate(X509Certificate[] certs) Overrides org. Implements org. Doc from org. Try to authenticate using a chain of
| |
| authenticate | back to summary |
|---|---|
| public Principal authenticate(GSSContext gssContext, boolean storeCreds) Overrides org. Implements org. Doc from org. Try to authenticate using a
| |
| authenticate | back to summary |
|---|---|
| public Principal authenticate(GSSName gssName, GSSCredential gssCredential) Overrides org. Implements org. Doc from org. Try to authenticate using a
| |
| filterLockedAccounts | back to summary |
|---|---|
| private Principal filterLockedAccounts(String username, Principal authenticatedUser) | |
| getCacheRemovalWarningTime | back to summary |
|---|---|
| public int getCacheRemovalWarningTime() Get the minimum period a failed authentication must remain in the cache to avoid generating a warning if it is removed from the cache to make space for a new entry.
| |
| getCacheSize | back to summary |
|---|---|
| public int getCacheSize() Get the maximum number of users for which authentication failure will be kept in the cache.
| |
| getFailureCount | back to summary |
|---|---|
| public int getFailureCount() Get the number of failed authentication attempts required to lock the user account.
| |
| getLockOutTime | back to summary |
|---|---|
| public int getLockOutTime() Get the period for which an account will be locked.
| |
| isLocked | back to summary |
|---|---|
| public boolean isLocked(String username) | |
| registerAuthFailure | back to summary |
|---|---|
| private void registerAuthFailure(String username) | |
| registerAuthSuccess | back to summary |
|---|---|
| private synchronized void registerAuthSuccess(String username) | |
| setCacheRemovalWarningTime | back to summary |
|---|---|
| public void setCacheRemovalWarningTime(int cacheRemovalWarningTime) Set the minimum period a failed authentication must remain in the cache to avoid generating a warning if it is removed from the cache to make space for a new entry.
| |
| setCacheSize | back to summary |
|---|---|
| public void setCacheSize(int cacheSize) Set the maximum number of users for which authentication failure will be kept in the cache.
| |
| setFailureCount | back to summary |
|---|---|
| public void setFailureCount(int failureCount) Set the number of failed authentication attempts required to lock the user account.
| |
| setLockOutTime | back to summary |
|---|---|
| public void setLockOutTime(int lockOutTime) Set the period for which an account will be locked.
| |
| startInternal | back to summary |
|---|---|
| protected void startInternal() throws LifecycleException Overrides org. Doc from org. Prepare for the beginning of active use of the public methods of this component and implement the requirements of
| |
| unlock | back to summary |
|---|---|
| public void unlock(String username) Unlock the specified username. This will remove all records of authentication failures for this user.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final AtomicInteger | |
| private long |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public int | |
| public long | |
| public void | |
| public void |
| failures | back to summary |
|---|---|
| private final AtomicInteger failures | |
| lastFailureTime | back to summary |
|---|---|
| private long lastFailureTime | |
| LockRecord | back to summary |
|---|---|
| protected LockRecord() | |
| getFailures | back to summary |
|---|---|
| public int getFailures() | |
| getLastFailureTime | back to summary |
|---|---|
| public long getLastFailureTime() | |
| registerFailure | back to summary |
|---|---|
| public void registerFailure() | |
| setFailures | back to summary |
|---|---|
| public void setFailures(int theFailures) | |