Class MessageLifetimeSecurityHandler

All Implemented Interfaces:
Component, DestructableComponent, InitializableComponent, MessageHandler

public class MessageLifetimeSecurityHandler
extends AbstractMessageHandler
Security message handler implementation that checks for validity of SAML message issue instant date and time.
  • Field Details

    • log

      @Nonnull private final org.slf4j.Logger log
      Class logger.
    • clockSkew

      @Nonnull private Duration clockSkew
      Clock skew adjustment in both directions to consider still acceptable (Default value: 3 minutes).
    • messageLifetime

      @Nonnull private Duration messageLifetime
      Amount of time for which a message is valid after it is issued (Default value: 3 minutes).
    • requiredRule

      private boolean requiredRule
      Whether this rule is required to be met.
  • Constructor Details

    • MessageLifetimeSecurityHandler

      public MessageLifetimeSecurityHandler()
      Constructor.
  • Method Details

    • getClockSkew

      @Nonnull public Duration getClockSkew()
      Get the clock skew.
      Returns:
      the clock skew
    • setClockSkew

      public void setClockSkew​(@Nonnull Duration skew)
      Set the clock skew.
      Parameters:
      skew - clock skew to set
    • getMessageLifetime

      @Nonnull public Duration getMessageLifetime()
      Gets the amount of time for which a message is valid.
      Returns:
      amount of time for which a message is valid
    • setMessageLifetime

      public void setMessageLifetime​(@Nonnull Duration lifetime)
      Sets the amount of time for which a message is valid.
      Parameters:
      lifetime - amount of time for which a message is valid
    • isRequiredRule

      public boolean isRequiredRule()
      Gets whether this rule is required to be met.
      Returns:
      whether this rule is required to be met
    • setRequiredRule

      public void setRequiredRule​(boolean required)
      Sets whether this rule is required to be met.
      Parameters:
      required - whether this rule is required to be met
    • doInvoke

      public void doInvoke​(@Nonnull MessageContext messageContext) throws MessageHandlerException
      Performs the handler logic.
      Specified by:
      doInvoke in class AbstractMessageHandler
      Parameters:
      messageContext - the message context on which to invoke the handler
      Throws:
      MessageHandlerException - if there is an error invoking the handler on the message context