Class DefaultUnregisteredClientPolicyValidator

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.idp.plugin.oidc.op.profile.logic.DefaultUnregisteredClientPolicyValidator
All Implemented Interfaces:
Predicate<Map<String,UnregisteredClientPolicy>>, Component, DestructableComponent, InitializableComponent

public class DefaultUnregisteredClientPolicyValidator extends AbstractInitializableComponent implements Predicate<Map<String,UnregisteredClientPolicy>>
Default validator for the unregistered client policies. Scope must be specified via value and/or custom operators. Response types must be specified via one_of and/or custom operators. Client ID and redirect URIs must be specified via one_of, regexp or custom operators.
Since:
3.0.0
  • Field Details

    • log

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

      @Nonnull private Predicate<Map<String,MetadataPolicy>> syntaxValidator
      The generic syntax validator for the policy.
  • Constructor Details

    • DefaultUnregisteredClientPolicyValidator

      public DefaultUnregisteredClientPolicyValidator()
      Constructor.
  • Method Details

    • setSyntaxValidator

      public void setSyntaxValidator(@Nonnull Predicate<Map<String,MetadataPolicy>> predicate)
      Set the generic syntax validator for the policy.
      Parameters:
      predicate - What to set.
    • test

      public boolean test(@Nullable Map<String,UnregisteredClientPolicy> map)
      Specified by:
      test in interface Predicate<Map<String,UnregisteredClientPolicy>>
    • verifyScopePolicy

      protected boolean verifyScopePolicy(@Nullable MetadataPolicy policy)
      Verifies that the scope is specified with value -operator.
      Parameters:
      policy - The policy to be verified.
      Returns:
      true if verified, false otherwise.
    • verifyResponseTypePolicy

      protected boolean verifyResponseTypePolicy(@Nullable MetadataPolicy policy)
      Verifies that the response type is specified with one_of -operator.
      Parameters:
      policy - The policy to be verified.
      Returns:
      true if verified, false otherwise.
    • verifyRedirectUriPolicy

      protected boolean verifyRedirectUriPolicy(@Nullable MetadataPolicy policy)
      Verifies that the redirect_uri is specified with one_of or regexp -operators.
      Parameters:
      policy - The policy to be verified.
      Returns:
      true if verified, false otherwise.
    • verifyClientIdPolicy

      protected boolean verifyClientIdPolicy(@Nullable MetadataPolicy policy)
      Verifies that the client_id is specified with one_of or regexp -operators.
      Parameters:
      policy - The policy to be verified.
      Returns:
      true if verified, false otherwise.
    • preChecksForMandatoryKey

      protected boolean preChecksForMandatoryKey(@Nullable MetadataPolicy policy, String key)
      Verifies that the policy is not containing forbidden content.
      Parameters:
      policy - The policy to be verified.
      key - The claim to be verified, used for logging only.
      Returns:
      true if verified, false otherwise.