Class EmailCooldownManager

java.lang.Object
org.keycloak.authentication.requiredactions.util.EmailCooldownManager

public class EmailCooldownManager extends Object
  • Field Details

    • EMAIL_RESEND_COOLDOWN_SECONDS

      public static final String EMAIL_RESEND_COOLDOWN_SECONDS
      See Also:
    • EMAIL_RESEND_COOLDOWN_DEFAULT_SECONDS

      public static final int EMAIL_RESEND_COOLDOWN_DEFAULT_SECONDS
      See Also:
  • Constructor Details

    • EmailCooldownManager

      public EmailCooldownManager()
  • Method Details

    • retrieveCooldownEntry

      public static Long retrieveCooldownEntry(RequiredActionContext context, String keyPrefix)
    • addCooldownEntry

      public static void addCooldownEntry(RequiredActionContext context, String keyPrefix)
    • addCooldownEntryIfAbsent

      public static boolean addCooldownEntryIfAbsent(AuthenticationFlowContext context, String keyPrefix, String id)
      Adds a cooldown entry for the id if there isn't one yet. The check and the add happen in one call, so two requests at the same time can't both get through.
      Returns:
      false if the id is still in cooldown
    • getHashedCacheKey

      public static String getHashedCacheKey(String keyPrefix, String id)
    • createCooldownConfigProperty

      public static ProviderConfigProperty createCooldownConfigProperty()