Interface ClaimAccessor

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods 
      Modifier and Type Method Description
      default java.lang.Boolean containsClaim​(java.lang.String claim)
      Deprecated.
      default <T> T getClaim​(java.lang.String claim)
      Returns the claim value as a T type.
      default java.lang.Boolean getClaimAsBoolean​(java.lang.String claim)
      Returns the claim value as a Boolean or null if the claim does not exist.
      default java.time.Instant getClaimAsInstant​(java.lang.String claim)
      Returns the claim value as an Instant or null if it does not exist.
      default java.util.Map<java.lang.String,​java.lang.Object> getClaimAsMap​(java.lang.String claim)
      Returns the claim value as a Map<String, Object> or null if the claim does not exist.
      default java.lang.String getClaimAsString​(java.lang.String claim)
      Returns the claim value as a String or null if it does not exist or is equal to null.
      default java.util.List<java.lang.String> getClaimAsStringList​(java.lang.String claim)
      Returns the claim value as a List<String> or null if the claim does not exist.
      default java.net.URL getClaimAsURL​(java.lang.String claim)
      Returns the claim value as an URL or null if it does not exist.
      java.util.Map<java.lang.String,​java.lang.Object> getClaims()
      Returns a set of claims that may be used for assertions.
      default boolean hasClaim​(java.lang.String claim)
      Returns true if the claim exists in getClaims(), otherwise false.
    • Method Detail

      • getClaims

        java.util.Map<java.lang.String,​java.lang.Object> getClaims()
        Returns a set of claims that may be used for assertions.
        Returns:
        a Map of claims
      • getClaim

        default <T> T getClaim​(java.lang.String claim)
        Returns the claim value as a T type. The claim value is expected to be of type T.
        Type Parameters:
        T - the type of the claim value
        Parameters:
        claim - the name of the claim
        Returns:
        the claim value
        Since:
        5.2
      • hasClaim

        default boolean hasClaim​(java.lang.String claim)
        Returns true if the claim exists in getClaims(), otherwise false.
        Parameters:
        claim - the name of the claim
        Returns:
        true if the claim exists, otherwise false
        Since:
        5.5
      • containsClaim

        @Deprecated
        default java.lang.Boolean containsClaim​(java.lang.String claim)
        Deprecated.
        Returns true if the claim exists in getClaims(), otherwise false.
        Parameters:
        claim - the name of the claim
        Returns:
        true if the claim exists, otherwise false
      • getClaimAsString

        default java.lang.String getClaimAsString​(java.lang.String claim)
        Returns the claim value as a String or null if it does not exist or is equal to null.
        Parameters:
        claim - the name of the claim
        Returns:
        the claim value or null if it does not exist or is equal to null
      • getClaimAsBoolean

        default java.lang.Boolean getClaimAsBoolean​(java.lang.String claim)
        Returns the claim value as a Boolean or null if the claim does not exist.
        Parameters:
        claim - the name of the claim
        Returns:
        the claim value or null if the claim does not exist
        Throws:
        java.lang.IllegalArgumentException - if the claim value cannot be converted to a Boolean
        java.lang.NullPointerException - if the claim value is null
      • getClaimAsInstant

        default java.time.Instant getClaimAsInstant​(java.lang.String claim)
        Returns the claim value as an Instant or null if it does not exist.
        Parameters:
        claim - the name of the claim
        Returns:
        the claim value or null if it does not exist
      • getClaimAsURL

        default java.net.URL getClaimAsURL​(java.lang.String claim)
        Returns the claim value as an URL or null if it does not exist.
        Parameters:
        claim - the name of the claim
        Returns:
        the claim value or null if it does not exist
      • getClaimAsMap

        default java.util.Map<java.lang.String,​java.lang.Object> getClaimAsMap​(java.lang.String claim)
        Returns the claim value as a Map<String, Object> or null if the claim does not exist.
        Parameters:
        claim - the name of the claim
        Returns:
        the claim value or null if the claim does not exist
        Throws:
        java.lang.IllegalArgumentException - if the claim value cannot be converted to a List
        java.lang.NullPointerException - if the claim value is null
      • getClaimAsStringList

        default java.util.List<java.lang.String> getClaimAsStringList​(java.lang.String claim)
        Returns the claim value as a List<String> or null if the claim does not exist.
        Parameters:
        claim - the name of the claim
        Returns:
        the claim value or null if the claim does not exist
        Throws:
        java.lang.IllegalArgumentException - if the claim value cannot be converted to a List
        java.lang.NullPointerException - if the claim value is null