Class BruteForceProtectionImpl

java.lang.Object
io.jmix.security.impl.BruteForceProtectionImpl
All Implemented Interfaces:
BruteForceProtection

@Component("sec_BruteForceProtection") public class BruteForceProtectionImpl extends Object implements BruteForceProtection
  • Constructor Details

    • BruteForceProtectionImpl

      public BruteForceProtectionImpl()
  • Method Details

    • init

      @PostConstruct protected void init()
    • isBlocked

      public boolean isBlocked(String username, String ipAddress)
      Description copied from interface: BruteForceProtection
      Returns a number of login attempts left for the specified pair of login and IP-address.
      Specified by:
      isBlocked in interface BruteForceProtection
      Parameters:
      username - username.
      ipAddress - user IP-address.
      Returns:
      true if count of login attempts left.
    • registerLoginFailed

      public void registerLoginFailed(String username, String ipAddress)
      Description copied from interface: BruteForceProtection
      Registers unsuccessful login attempt.
      Specified by:
      registerLoginFailed in interface BruteForceProtection
    • registerLoginSucceeded

      public void registerLoginSucceeded(String username, String ipAddress)
      Description copied from interface: BruteForceProtection
      Registers successful login attempt. Clear attempts count for user.
      Specified by:
      registerLoginSucceeded in interface BruteForceProtection
      Parameters:
      username - username.
      ipAddress - user IP-address.
    • isProtectionEnabled

      public boolean isProtectionEnabled()
      Specified by:
      isProtectionEnabled in interface BruteForceProtection
      Returns:
      true if brute-force protection is enabled in application settings.