private Principal filterLockedAccounts(String username, Principal authenticatedUser) { // Register all failed authentications if (authenticatedUser == null && isAvailable()) { registerAuthFailure(username); } if (isLocked(username)) { // If the user is currently locked, authentication will always fail log.warn(sm.getString("lockOutRealm.authLockedUser", username)); return null; } if (authenticatedUser != null) { registerAuthSuccess(username); } return authenticatedUser; }
/** * Return the Principal associated with the specified username and * credentials, if there is one; otherwise return <code>null</code>. * * @param username Username of the Principal to look up * @param credentials Password or other credentials to use in * authenticating this username */ @Override public Principal authenticate(String username, String credentials) { if (isLocked(username)) { // Trying to authenticate a locked user is an automatic failure registerAuthFailure(username); log.warn(sm.getString("lockOutRealm.authLockedUser", username)); return null; } Principal authenticatedUser = super.authenticate(username, credentials); if (authenticatedUser == null) { registerAuthFailure(username); } else { registerAuthSuccess(username); } return authenticatedUser; }
/** * Unlock the specified username. This will remove all records of * authentication failures for this user. * * @param username The user to unlock */ public void unlock(String username) { // Auth success clears the lock record so... registerAuthSuccess(username); }
/** * Return the Principal associated with the specified username and * credentials, if there is one; otherwise return <code>null</code>. * * @param username Username of the Principal to look up * @param credentials Password or other credentials to use in * authenticating this username */ @Override public Principal authenticate(String username, String credentials) { Principal authenticatedUser = super.authenticate(username, credentials); return filterLockedAccounts(username, authenticatedUser); }
/** * Return the Principal associated with the specified username and * credentials, if there is one; otherwise return <code>null</code>. * * @param username Username of the Principal to look up * @param credentials Password or other credentials to use in * authenticating this username */ @Override public Principal authenticate(String username, String credentials) { if (isLocked(username)) { // Trying to authenticate a locked user is an automatic failure registerAuthFailure(username); log.warn(sm.getString("lockOutRealm.authLockedUser", username)); return null; } Principal authenticatedUser = super.authenticate(username, credentials); if (authenticatedUser == null) { registerAuthFailure(username); } else { registerAuthSuccess(username); } return authenticatedUser; }
/** * Unlock the specified username. This will remove all records of * authentication failures for this user. * * @param username The user to unlock */ public void unlock(String username) { // Auth success clears the lock record so... registerAuthSuccess(username); }
/** * Return the Principal associated with the specified username and * credentials, if there is one; otherwise return <code>null</code>. * * @param username Username of the Principal to look up * @param credentials Password or other credentials to use in * authenticating this username */ @Override public Principal authenticate(String username, String credentials) { Principal authenticatedUser = super.authenticate(username, credentials); return filterLockedAccounts(username, authenticatedUser); }
/** * Return the Principal associated with the specified username and * credentials, if there is one; otherwise return <code>null</code>. * * @param username Username of the Principal to look up * @param credentials Password or other credentials to use in * authenticating this username */ @Override public Principal authenticate(String username, String credentials) { if (isLocked(username)) { // Trying to authenticate a locked user is an automatic failure registerAuthFailure(username); log.warn(sm.getString("lockOutRealm.authLockedUser", username)); return null; } Principal authenticatedUser = super.authenticate(username, credentials); if (authenticatedUser == null) { registerAuthFailure(username); } else { registerAuthSuccess(username); } return authenticatedUser; }
private Principal filterLockedAccounts(String username, Principal authenticatedUser) { // Register all failed authentications if (authenticatedUser == null && isAvailable()) { registerAuthFailure(username); } if (isLocked(username)) { // If the user is currently locked, authentication will always fail log.warn(sm.getString("lockOutRealm.authLockedUser", username)); return null; } if (authenticatedUser != null) { registerAuthSuccess(username); } return authenticatedUser; }
/** * Unlock the specified username. This will remove all records of * authentication failures for this user. * * @param username The user to unlock */ public void unlock(String username) { // Auth success clears the lock record so... registerAuthSuccess(username); }
/** * Return the Principal associated with the specified chain of X509 * client certificates. If there is none, return <code>null</code>. * * @param certs Array of client certificates, with the first one in * the array being the certificate of the client itself. */ @Override public Principal authenticate(X509Certificate[] certs) { String username = null; if (certs != null && certs.length >0) { username = certs[0].getSubjectDN().getName(); } Principal authenticatedUser = super.authenticate(certs); return filterLockedAccounts(username, authenticatedUser); }
/** * Return the Principal associated with the specified username and * credentials, if there is one; otherwise return <code>null</code>. * * @param username Username of the Principal to look up * @param credentials Password or other credentials to use in * authenticating this username */ @Override public Principal authenticate(String username, String credentials) { if (isLocked(username)) { // Trying to authenticate a locked user is an automatic failure registerAuthFailure(username); log.warn(sm.getString("lockOutRealm.authLockedUser", username)); return null; } Principal authenticatedUser = super.authenticate(username, credentials); if (authenticatedUser == null) { registerAuthFailure(username); } else { registerAuthSuccess(username); } return authenticatedUser; }
/** * Unlock the specified username. This will remove all records of * authentication failures for this user. * * @param username The user to unlock */ public void unlock(String username) { // Auth success clears the lock record so... registerAuthSuccess(username); }
/** * Return the Principal associated with the specified chain of X509 * client certificates. If there is none, return <code>null</code>. * * @param certs Array of client certificates, with the first one in * the array being the certificate of the client itself. */ @Override public Principal authenticate(X509Certificate[] certs) { String username = null; if (certs != null && certs.length >0) { username = certs[0].getSubjectDN().getName(); } Principal authenticatedUser = super.authenticate(certs); return filterLockedAccounts(username, authenticatedUser); }
/** * Return the Principal associated with the specified username and * credentials, if there is one; otherwise return <code>null</code>. * * @param username Username of the Principal to look up * @param credentials Password or other credentials to use in * authenticating this username */ @Override public Principal authenticate(String username, String credentials) { if (isLocked(username)) { // Trying to authenticate a locked user is an automatic failure registerAuthFailure(username); log.warn(sm.getString("lockOutRealm.authLockedUser", username)); return null; } Principal authenticatedUser = super.authenticate(username, credentials); if (authenticatedUser == null) { registerAuthFailure(username); } else { registerAuthSuccess(username); } return authenticatedUser; }
/** * Unlock the specified username. This will remove all records of * authentication failures for this user. * * @param username The user to unlock */ public void unlock(String username) { // Auth success clears the lock record so... registerAuthSuccess(username); }
/** * Return the Principal associated with the specified username, which * matches the digest calculated using the given parameters using the * method described in RFC 2069; otherwise return <code>null</code>. * * @param username Username of the Principal to look up * @param clientDigest Digest which has been submitted by the client * @param nonce Unique (or supposedly unique) token which has been used * for this request * @param realmName Realm name * @param md5a2 Second MD5 digest used to calculate the digest : * MD5(Method + ":" + uri) */ @Override public Principal authenticate(String username, String clientDigest, String nonce, String nc, String cnonce, String qop, String realmName, String md5a2) { Principal authenticatedUser = super.authenticate(username, clientDigest, nonce, nc, cnonce, qop, realmName, md5a2); return filterLockedAccounts(username, authenticatedUser); }
/** * Return the Principal associated with the specified username and * credentials, if there is one; otherwise return <code>null</code>. * * @param username Username of the Principal to look up * @param credentials Password or other credentials to use in * authenticating this username */ @Override public Principal authenticate(String username, String credentials) { if (isLocked(username)) { // Trying to authenticate a locked user is an automatic failure registerAuthFailure(username); log.warn(sm.getString("lockOutRealm.authLockedUser", username)); return null; } Principal authenticatedUser = super.authenticate(username, credentials); if (authenticatedUser == null) { registerAuthFailure(username); } else { registerAuthSuccess(username); } return authenticatedUser; }
/** * Unlock the specified username. This will remove all records of * authentication failures for this user. * * @param username The user to unlock */ public void unlock(String username) { // Auth success clears the lock record so... registerAuthSuccess(username); }
/** * Return the Principal associated with the specified username, which * matches the digest calculated using the given parameters using the * method described in RFC 2069; otherwise return <code>null</code>. * * @param username Username of the Principal to look up * @param clientDigest Digest which has been submitted by the client * @param nonce Unique (or supposedly unique) token which has been used * for this request * @param realmName Realm name * @param md5a2 Second MD5 digest used to calculate the digest : * MD5(Method + ":" + uri) */ @Override public Principal authenticate(String username, String clientDigest, String nonce, String nc, String cnonce, String qop, String realmName, String md5a2) { Principal authenticatedUser = super.authenticate(username, clientDigest, nonce, nc, cnonce, qop, realmName, md5a2); return filterLockedAccounts(username, authenticatedUser); }