com.basecmp.core.util
Class MaxAttemptLoginConstraint

java.lang.Object
  extended bycom.basecmp.core.util.LoginConstraint
      extended bycom.basecmp.core.util.MaxAttemptLoginConstraint

public class MaxAttemptLoginConstraint
extends LoginConstraint

Disables the login for a user if the maximum number of failed login-attempts has been reached. Configvalues:
MaxLoginAttempts - Maximum of allowed login-attempts before the account will be disabled. Defaults to 3.
LoginAttemptDelayOffset - Minimum time in milliseconds after a disabled login will be automatically re-enabled. Default to 10 minutes.
LoginAttemptDelay - Additional delay-time in milliseconds for each false login-attempt after a login has already be disabled. Defaults to 1 minute. Created on 08.01.2007

Author:
Wolfgang Schröder

Field Summary
static java.lang.String CONFIG_PARAM_LOGIN_DELAY
           
static java.lang.String CONFIG_PARAM_LOGIN_DELAY_OFFSET
           
static java.lang.String CONFIG_PARAM_MAX_ATTEMPTS
           
static long DEFAULT_LOGIN_DELAY
           
static long DEFAULT_LOGIN_DELAY_OFFSET
           
static int DEFAULT_MAX_ATTEMPTS
           
static java.lang.String REQUEST_ATTRIBUTE_MAX_ATTEMPTS
           
static java.lang.String REQUEST_ATTRIBUTE_SECCONDS_TO_NEXT_ATTEMPT
           
 
Fields inherited from class com.basecmp.core.util.LoginConstraint
FORCE_LOGIN, LOGIN_TEMPORARILY_DISABLED, OK, SEND_FORBIDDEN
 
Constructor Summary
MaxAttemptLoginConstraint()
           
 
Method Summary
 int checkConstraint(ServletRequest request)
           
 void init(FilterConfig config)
           
 java.lang.String printConfig()
           
 void processFailedLoginAttempt(java.lang.String username)
           
 
Methods inherited from class com.basecmp.core.util.LoginConstraint
getFilter, init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONFIG_PARAM_LOGIN_DELAY

public static final java.lang.String CONFIG_PARAM_LOGIN_DELAY
See Also:
Constant Field Values

CONFIG_PARAM_LOGIN_DELAY_OFFSET

public static final java.lang.String CONFIG_PARAM_LOGIN_DELAY_OFFSET
See Also:
Constant Field Values

CONFIG_PARAM_MAX_ATTEMPTS

public static final java.lang.String CONFIG_PARAM_MAX_ATTEMPTS
See Also:
Constant Field Values

DEFAULT_LOGIN_DELAY

public static final long DEFAULT_LOGIN_DELAY
See Also:
Constant Field Values

DEFAULT_LOGIN_DELAY_OFFSET

public static final long DEFAULT_LOGIN_DELAY_OFFSET
See Also:
Constant Field Values

DEFAULT_MAX_ATTEMPTS

public static final int DEFAULT_MAX_ATTEMPTS
See Also:
Constant Field Values

REQUEST_ATTRIBUTE_MAX_ATTEMPTS

public static final java.lang.String REQUEST_ATTRIBUTE_MAX_ATTEMPTS
See Also:
Constant Field Values

REQUEST_ATTRIBUTE_SECCONDS_TO_NEXT_ATTEMPT

public static final java.lang.String REQUEST_ATTRIBUTE_SECCONDS_TO_NEXT_ATTEMPT
See Also:
Constant Field Values
Constructor Detail

MaxAttemptLoginConstraint

public MaxAttemptLoginConstraint()
Method Detail

checkConstraint

public int checkConstraint(ServletRequest request)
Specified by:
checkConstraint in class LoginConstraint

init

public void init(FilterConfig config)
          throws ServletException
Specified by:
init in class LoginConstraint
Throws:
ServletException

printConfig

public java.lang.String printConfig()
Specified by:
printConfig in class LoginConstraint

processFailedLoginAttempt

public void processFailedLoginAttempt(java.lang.String username)
Overrides:
processFailedLoginAttempt in class LoginConstraint


Copyright © 2004 by basecmp® - Professional Web Solutions