Interface ScopeConfig

All Superinterfaces:
SerializableAsMap

public interface ScopeConfig extends SerializableAsMap
Generic scope (not specifically OAuth).
Since:
4.0.0
  • Method Details

    • getDescription

      String getDescription()
      Returns:
      a description of this scope.
    • getTimeToLive

      Optional<Duration> getTimeToLive()
      Returns:
      time-to-live if any. If not-specified, should be treated as infinite.
    • exposeInMetadata

      boolean exposeInMetadata()
      Returns:
      whether this scope should be exposed in metadata.
    • isRequired

      boolean isRequired()
      Returns:
      whether this scope is a required scope.
    • isConsentable

      boolean isConsentable()
      Returns:
      true if this is a consentable scope.

      Consentable scopes are scopes which do not map to any claim but require user consent when that feature is enabled.

      Notice that scopes that map to different claims are never consentable by themselves as the claims are consented to in that case, rather than the scope.

      Since:
      4.1.0
    • matches

      boolean matches(String scope)
      Check if the given scope matches this scope.

      The provided scope is expected to be a single item, not a whitespace-separated list of scopes.

      Parameters:
      scope - single scope
      Returns:
      whether the given scope matches this scope
    • isPrefix

      boolean isPrefix()
      Check if this scope is a prefix scope.
      Returns:
      whether this scope is a prefix scope
      Since:
      6.3.0
    • getRawSpecification

      String getRawSpecification()
      Returns:
      the raw specification of this scope. This is the String used by admins to specify the scope, regardless of its other characteristics.
    • getSuffix

      @Nullable @Nullable String getSuffix(String scope)
      Get the suffix of a given scope if this scope is a prefix scope that matches it.
      Parameters:
      scope - single scope
      Returns:
      the suffix, or null if this isn't a prefix scope or the given scope doesn't match
      Since:
      6.3.0
    • getProperties

      Map<String,String> getProperties()
      Returns:
      scope metadata.
    • toLogString

      String toLogString()
      Returns:
      a simple String that represents this scope and can be used for logging purposes.
    • getClaimNames

      Set<String> getClaimNames()
      Returns:
      the set of claim names provided by this scope
      Since:
      4.1.0