Class AuthenticationThrottleManager

java.lang.Object
com.jalios.jcms.security.Throttler
com.jalios.jcms.authentication.AuthenticationThrottleManager

public final class AuthenticationThrottleManager extends Throttler
This singleton manages authentication throttling.
Since:
jcms-10.0.7 / JCMS-8083
  • Field Details

    • ENABLED_PROP

      public static final String ENABLED_PROP
      Enable throttling or not ?
      See Also:
    • RANGE_PROP

      public static final String RANGE_PROP
      Time range in seconds during which the threshold is verified.
      See Also:
    • THRESHOLD_PROP

      public static final String THRESHOLD_PROP
      Number of failed login attempts permitted in specified time range.
      See Also:
    • THROTTLING_DURATION_PROP

      public static final String THROTTLING_DURATION_PROP
      Number of seconds before the blocked/throttled can be released.
      See Also:
  • Method Details

    • getInstance

      public static final AuthenticationThrottleManager getInstance()
    • recordAuthenticationFailure

      public void recordAuthenticationFailure(String userId, AuthenticationContext ctxt, Class<? extends AuthenticationHandler> authHdlrClass)
      Record a failed authentication attempt.

      Records of failed authentication must be performed to ensure throttling of brute force authentication atttempt for same context (user/ip).

      Parameters:
      userId - a unique and constant identifier used to track the User/Member for which authentication failed
      ctxt - the AuthenticationContext associated to the authentication attempt
      authHdlrClass - the class of AuthenticationHandler trying to handle the authentication attempt
      Since:
      jcms-10.0.7 / JCMS-8083
    • throttleIfNeeded

      public boolean throttleIfNeeded(String userId, AuthenticationContext ctxt, Class<? extends AuthenticationHandler> authHdlrClass)
      Throttle an authentication attempt given specified context.
      Parameters:
      userId - a unique and constant identifier used to track the User/Member for which authentication is being attempted
      ctxt - the AuthenticationContext associated to the authentication attempt
      authHdlrClass - the class of AuthenticationHandler trying to handle the authentication attempt
      Returns:
      true if thottling occurred, false otherwise
      Since:
      jcms-10.0.7 / JCMS-8083