Record Class RequestedCredentials

java.lang.Object
java.lang.Record
org.keycloak.broker.oid4vp.RequestedCredentials
Record Components:
credentials - the requested credentials, each becoming one credential query
credentialSets - the combinations of credentials the wallet may present, all credentials are required if there are none
principal - the credential and claim that become the brokered user id

public record RequestedCredentials(List<RequestedCredentials.Credential> credentials, List<RequestedCredentials.CredentialSet> credentialSets, RequestedCredentials.Principal principal) extends Record
The credentials the verifier requests from the wallet and the claim that links the user. The DCQL query is generated from it together with the identity provider mappers, and the wallet response is verified against it.
  • Constructor Details

  • Method Details

    • parse

      public static RequestedCredentials parse(String json)
      Parses and validates the credentials. Unknown members are rejected, so a typo does not silently change what is requested.
      Throws:
      IllegalArgumentException - if the credentials are invalid
    • credential

    • isSatisfiedBy

      public boolean isSatisfiedBy(Set<String> presentedIds)
      Whether the presented credentials satisfy every required credential set, or contain all credentials if there are no credential sets.
    • isPrincipalAlwaysPresented

      public boolean isPrincipalAlwaysPresented()
      Whether every presentation that satisfies the query carries the principal credential, which holds when it is part of every option of at least one required credential set.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • credentials

      public List<RequestedCredentials.Credential> credentials()
      Returns the value of the credentials record component.
      Returns:
      the value of the credentials record component
    • credentialSets

      public List<RequestedCredentials.CredentialSet> credentialSets()
      Returns the value of the credentialSets record component.
      Returns:
      the value of the credentialSets record component
    • principal

      public RequestedCredentials.Principal principal()
      Returns the value of the principal record component.
      Returns:
      the value of the principal record component