Class MessageLifetimeSecurityHandler

  • All Implemented Interfaces:
    net.shibboleth.utilities.java.support.component.Component, net.shibboleth.utilities.java.support.component.DestructableComponent, net.shibboleth.utilities.java.support.component.InitializableComponent, org.opensaml.messaging.handler.MessageHandler

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

      Fields 
      Modifier and Type Field Description
      private Duration clockSkew
      Clock skew adjustment in both directions to consider still acceptable (Default value: 3 minutes).
      private org.slf4j.Logger log
      Class logger.
      private Duration messageLifetime
      Amount of time for which a message is valid after it is issued (Default value: 3 minutes).
      private boolean requiredRule
      Whether this rule is required to be met.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void doInvoke​(org.opensaml.messaging.context.MessageContext messageContext)
      Duration getClockSkew()
      Get the clock skew.
      Duration getMessageLifetime()
      Gets the amount of time for which a message is valid.
      boolean isRequiredRule()
      Gets whether this rule is required to be met.
      void setClockSkew​(Duration skew)
      Set the clock skew.
      void setMessageLifetime​(Duration lifetime)
      Sets the amount of time for which a message is valid.
      void setRequiredRule​(boolean required)
      Sets whether this rule is required to be met.
      • Methods inherited from class org.opensaml.messaging.handler.AbstractMessageHandler

        doPostInvoke, doPostInvoke, doPreInvoke, getActivationCondition, getLogPrefix, invoke, setActivationCondition
      • Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent

        destroy, doDestroy, doInitialize, initialize, isDestroyed, isInitialized
      • Methods inherited from interface net.shibboleth.utilities.java.support.component.InitializableComponent

        initialize, isInitialized
    • Field Detail

      • 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 Detail

      • MessageLifetimeSecurityHandler

        public MessageLifetimeSecurityHandler()
        Constructor.
    • Method Detail

      • 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
                             org.opensaml.messaging.context.MessageContext messageContext)
                      throws org.opensaml.messaging.handler.MessageHandlerException
        Specified by:
        doInvoke in class org.opensaml.messaging.handler.AbstractMessageHandler
        Throws:
        org.opensaml.messaging.handler.MessageHandlerException