Package org.keycloak.broker.oid4vp
Record Class RequestedCredentials
java.lang.Object
java.lang.Record
org.keycloak.broker.oid4vp.RequestedCredentials
- Record Components:
credentials- the requested credentials, each becoming one credential querycredentialSets- the combinations of credentials the wallet may present, all credentials are required if there are noneprincipal- 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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic final recordstatic final record -
Constructor Summary
ConstructorsConstructorDescriptionRequestedCredentials(List<RequestedCredentials.Credential> credentials, List<RequestedCredentials.CredentialSet> credentialSets, RequestedCredentials.Principal principal) Creates an instance of aRequestedCredentialsrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncredential(String id) Returns the value of thecredentialsrecord component.Returns the value of thecredentialSetsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanWhether 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.booleanisSatisfiedBy(Set<String> presentedIds) Whether the presented credentials satisfy every required credential set, or contain all credentials if there are no credential sets.static RequestedCredentialsParses and validates the credentials.Returns the value of theprincipalrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
RequestedCredentials
public RequestedCredentials(List<RequestedCredentials.Credential> credentials, List<RequestedCredentials.CredentialSet> credentialSets, RequestedCredentials.Principal principal) Creates an instance of aRequestedCredentialsrecord class.- Parameters:
credentials- the value for thecredentialsrecord componentcredentialSets- the value for thecredentialSetsrecord componentprincipal- the value for theprincipalrecord component
-
-
Method Details
-
parse
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
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
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
credentials
Returns the value of thecredentialsrecord component.- Returns:
- the value of the
credentialsrecord component
-
credentialSets
Returns the value of thecredentialSetsrecord component.- Returns:
- the value of the
credentialSetsrecord component
-
principal
Returns the value of theprincipalrecord component.- Returns:
- the value of the
principalrecord component
-