Class SAML2Support


  • public final class SAML2Support
    extends Object
    Utility class for common SAML 2 operations.
    • Constructor Detail

      • SAML2Support

        private SAML2Support()
        Private constructor to disallow instantiation.
    • Method Detail

      • isValid

        public static boolean isValid​(org.opensaml.core.xml.XMLObject xmlObject)
        Checks to see if the given XMLObject is still valid. An XMLObject is valid if, and only if, itself and every ancestral TimeBoundSAMLObject is valid.
        Parameters:
        xmlObject - the XML object tree to check
        Returns:
        true of the tree is valid, false if not
      • getEarliestExpiration

        @Nullable
        public static Instant getEarliestExpiration​(@Nullable
                                                    org.opensaml.core.xml.XMLObject xmlObject)
        Gets the earliest expiration instant for a XMLObject. This method traverses the tree of SAMLObject rooted at the given object and calculates the earliest expiration as the earliest of the following two items:
        Parameters:
        xmlObject - the XML object tree from which to get the earliest expiration time
        Returns:
        the earliest expiration time
      • getEarliestExpiration

        @Nullable
        public static Instant getEarliestExpiration​(@Nullable
                                                    org.opensaml.core.xml.XMLObject xmlObject,
                                                    @Nullable
                                                    Instant candidateTime,
                                                    @Nonnull
                                                    Instant now)
        Gets the earliest expiration instant within a metadata tree.
        Parameters:
        xmlObject - the target XMLObject to evaluate
        candidateTime - the candidate earliest expiration instant
        now - when this method was called
        Returns:
        the earliest expiration instant within a metadata tree. May be null if the input candiateTime was null, otherwise will always be non-null.
      • getEarliestExpirationFromCacheable

        @Nullable
        public static Instant getEarliestExpirationFromCacheable​(@Nonnull
                                                                 CacheableSAMLObject cacheableObject,
                                                                 @Nullable
                                                                 Instant candidateTime,
                                                                 @Nonnull
                                                                 Instant now)
        Gets the earliest effective expiration instant of the specified cacheable SAML object and the specified candidate time.
        Parameters:
        cacheableObject - the target XMLObject to evaluate
        candidateTime - the candidate earliest expiration instant
        now - when this method was called
        Returns:
        the earliest effective expiration instant of the 2 targets. May be null if the input candiateTime was null, otherwise will always be non-null.
      • getEarliestExpirationFromTimeBound

        @Nullable
        public static Instant getEarliestExpirationFromTimeBound​(@Nonnull
                                                                 TimeBoundSAMLObject timeBoundObject,
                                                                 @Nullable
                                                                 Instant candidateTime)
        Gets the earliest effective expiration instant of the specified time-bound SAML object and the specified candidate time.
        Parameters:
        timeBoundObject - the target XMLObject to evaluate
        candidateTime - the earliest expiration instant
        Returns:
        the earliest effective expiration instant of the 2 targets. May be null if the input candiateTime was null, otherwise will always be non-null.