Class SimplePresentationDefinition

java.lang.Object
org.keycloak.sdjwt.consumer.SimplePresentationDefinition
All Implemented Interfaces:
PresentationRequirements

public class SimplePresentationDefinition extends Object implements PresentationRequirements
A simple presentation definition of the kind of credential expected.

The credential's type and required claims are configured using regex patterns. The values of these fields are JSON-ified prior to matching the regex pattern.

Author:
Ingrid Kamga
  • Constructor Details

    • SimplePresentationDefinition

      public SimplePresentationDefinition(Map<String,Pattern> requirements)
  • Method Details

    • checkIfSatisfiedBy

      public void checkIfSatisfiedBy(com.fasterxml.jackson.databind.JsonNode disclosedPayload) throws VerificationException
      Checks if the provided JSON payload satisfies all required field patterns.

      For each required field, the corresponding JSON field value in the disclosed Issuer-signed JWT's payload is matched against the associated regex pattern. If any required field is missing or does not match the pattern, a VerificationException is thrown.

      Specified by:
      checkIfSatisfiedBy in interface PresentationRequirements
      Parameters:
      disclosedPayload - The fully disclosed Issuer-signed JWT of the presented token.
      Throws:
      VerificationException - If any required field is missing or fails the pattern check.
    • builder

      public static SimplePresentationDefinition.Builder builder()