You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Comments in JSON to be removed before merging PR, they are just here to make Brian less sad
10
-
"claims": [ // define claims, may add other properties like a purpose to each claims
11
-
{
12
-
"id": "a", // required for use in claim_sets below; if that is omitted, the id is optional
13
-
"path": ["last_name"]
14
-
},
9
+
"claims": [
10
+
{"id": "a","path": ["last_name"]},
15
11
{"id": "b", "path": ["postal_code"]},
16
12
{"id": "c", "path": ["locality"]},
17
13
{"id": "d", "path": ["region"]},
18
-
{"id": "e", "path": ["date_of_birth"]},
19
-
{"id": "f", "path": ["email"]}
14
+
{"id": "e", "path": ["date_of_birth"]}
20
15
],
21
-
"claim_sets": [ // defines the rules
22
-
// postal code or (locality and region), last_name, and date_of_birth are mandatory; email is required if present on the matched credential
23
-
["a", "b", "e", "f?!"],
24
-
["a", "c", "d", "e", "f?!"]
25
-
// Note: the ?! to mark a claim as `required if present` is syntactical sugar; the rules could be rewritten without it, but that would require a lot of repetition
Copy file name to clipboardExpand all lines: openid-4-verifiable-presentations-1_0.md
+60-39
Original file line number
Diff line number
Diff line change
@@ -627,7 +627,7 @@ the Wallet when processing the query.
627
627
628
628
## Credential Query {#credential_query}
629
629
630
-
A Credential Query is an object representing a request for one specific
630
+
A Credential Query is an object representing a request for a presentation of one
631
631
Credential.
632
632
633
633
Each entry in `credentials` MUST be an object with the following properties:
@@ -656,32 +656,40 @@ Credential.
656
656
claims in the requested Credentials.
657
657
658
658
`claim_sets`:
659
-
: OPTIONAL. A non-empty array containing arrays of identifiers for elements in
660
-
`claims`. The identifier MAY be postfixed by `?!` indicating that
661
-
delivery of the respective claim is required if present on the credential, see (#selecting_claims) for more details.
659
+
: OPTIONAL. A non-empty array containing arrays of identifiers for
660
+
elements in `claims`. The rules for selecting claims to send are defined in (#selecting_claims).
661
+
662
+
Note that multiple Credential Queries in a request MAY request a presentation of the same Credential.
662
663
663
664
## Credential Set Query {#credential_set_query}
664
665
665
666
A Credential Set Query is an object representing a request for one or more credentials to satisfy
666
-
a particular usecase with the Verifier.
667
+
a particular use case with the Verifier.
667
668
668
669
Each entry in `credential_sets` MUST be an object with the following properties:
669
670
670
-
`query_options`
671
+
`options`
671
672
: REQUIRED: A non-empty array, where each value in the array represents a distinct query that satisfies
672
-
the Usecase. The value of each element in the `query_options` array, is an array of identifiers which reference
673
+
the use case. The value of each element in the `options` array is an array of identifiers which reference
673
674
elements in `credentials`.
674
675
675
676
`required`
676
677
: OPTIONAL. A boolean flag which indicates whether the wallet is required to respond to the query.
677
678
If omitted, the effective value MUST be processed as `true`.
678
679
680
+
`purpose`
681
+
: OPTIONAL. A string, number or object specifying the purpose of the
682
+
query. This specification does not define a specific structure or specific values
683
+
for this property. The purpose is intended to be used by the Verifier to
684
+
communicate the reason for the query to the Wallet. The Wallet MAY use this
685
+
information to show the user the reason for the request.
686
+
679
687
## Claims Query {#claims_query}
680
688
681
689
Each entry in `claims` MUST be an object with the following properties:
682
690
683
691
`id`:
684
-
: REQUIRED if `claim_sets` is present; OPTIONAL otherwise. A string
692
+
: REQUIRED if `claim_sets` is present in the Credential Query; OPTIONAL otherwise. A string
685
693
identifying the particular claim. The value MUST be a non-empty string
686
694
consisting of alphanumeric, underscore (`_`) or hyphen (`-`) characters.
687
695
Within the particular `claims` array, the same `id` MUST NOT
@@ -704,8 +712,8 @@ in the mdoc, e.g., `first_name`.
704
712
705
713
`values`:
706
714
: OPTIONAL. An array of strings, integers or boolean values that specifies the expected values of the claim.
707
-
If the `values` property is present, the Wallet MUST return the claim only if the
708
-
type and value of the claim both match for at least one of the elements in the array.
715
+
If the `values` property is present, the Wallet SHOULD return the claim only if the
716
+
type and value of the claim both match for at least one of the elements in the array. Details of the processing rules are defined in (#selecting_claims).
709
717
710
718
### Selecting Claims and Credentials {#vp_query_lang_processing_rules}
711
719
@@ -726,22 +734,31 @@ The following rules apply for selecting claims via `claims` and `claim_sets`:
726
734
- If `claims` is provided, but `claim_sets` is not provided,
727
735
the Verifier requests all claims listed in `claims`.
728
736
- Otherwise, the Verifier requests one combination of the claims listed in
729
-
`claim_sets`. Claims listed without a postfix are requested unconditionally.
730
-
Claims postfixed by `?!` have to be provided by the Wallet if they exist on
731
-
the matched Credential. The order of the options conveyed in the `claim_sets`
732
-
array expresses the Verifiers preference for what is returned. A wallet MUST
733
-
prioritise returning the most preferred option.
737
+
`claim_sets`. The order of the options conveyed in the `claim_sets`
738
+
array expresses the Verifiers' preference for what is returned; the Wallet MUST return
739
+
the first option that it can satisfy. If the Wallet cannot satisfy any of the
740
+
options, it MUST NOT return any claims.
741
+
742
+
When a Claims Query contains a restriction on the values of a claim, the Wallet
743
+
SHOULD NOT return the claim if its value does not match at least one of the
744
+
elements in `values` i.e., the claim should be treated the same as if it did not
745
+
exist in the Credential. Implementing this restriction may not be possible in
746
+
all cases, for example, if the Wallet does not have access to the claim value
747
+
before presentation or user consent or if another component routing
748
+
the request to the Wallet does not have access to the claim value. Therefore, Verifiers
749
+
must treat restrictions expressed using `values` as a best-effort way to improve
750
+
user privacy, but MUST NOT rely on it for security checks.
734
751
735
752
The purpose of the `claim_sets` syntax is to provide a way for a
736
753
verifier to describe alternative ways a given credential can satisfy the request.
737
-
The array ordering expresses the Verifier's preference for how the request should
738
-
be fulfilled where the first element in the array is the most preferred and the last
739
-
element in the array is the least preferred. Verifiers should use the principle of
754
+
The array ordering expresses the Verifier's preference for how the request must
755
+
be fulfilled. The first element in the array is the most preferred and the last
756
+
element in the array is the least preferred. Verifiers SHOULD use the principle of
740
757
least information disclosure to influence how they order these options. For example, a
741
758
proof of age request should prioritize requesting an attribute like `age_over_18` over
742
759
an attribute like `birth_date`.
743
760
744
-
If the Wallet cannot deliver all unconditional claims requested by the Verifier
761
+
If the Wallet cannot deliver all claims requested by the Verifier
745
762
according to these rules, it MUST NOT return the respective Credential.
746
763
747
764
#### Selecting Credentials
@@ -753,15 +770,18 @@ The following rules apply for selecting Credentials via `credentials` and `crede
753
770
- Otherwise, the Verifier requests all of the credential set queries in the `credential_sets` array
754
771
with `required` evaluated as true to be returned at a minimum and optionally any of the credential set queries
755
772
with `required` evaluated as false.
756
-
- For each credential set query inside the `credential_sets` array, in order to satisfy the query, the Wallet MUST return
757
-
a credential or credentials that match to one of the `query_options` inside the object.
773
+
- For each credential set query inside the `credential_sets` array, in order to
774
+
satisfy the query, the Wallet MUST return a credential or credentials that
775
+
match to one of the `options` inside the object. It is typically
776
+
expected that the Wallet presents the End-User with a choice of which
777
+
credential to present if multiple credentials match the query.
758
778
759
779
Credentials not matching the respective constraints expressed within
760
780
`credentials` MUST NOT be returned, i.e., they are treated as if
761
781
they would not exist in the Wallet.
762
782
763
-
If the Wallet cannot deliver all non-optional Credentials requested by the Verifier according to these rules, it MUST NOT
764
-
return any credential(s).
783
+
If the Wallet cannot deliver all non-optional Credentials requested by the
784
+
Verifier according to these rules, it MUST NOT return any credential(s).
@@ -783,10 +803,6 @@ the inheritance logic defined in [@!I-D.ietf-oauth-sd-jwt-vc].
783
803
doctype of the requested Verifiable Credential. All elements in the array MUST
784
804
be valid doctype identifiers as defined in ISO 18013-5.
785
805
786
-
### Format `jwt_vp*`
787
-
788
-
TBD
789
-
790
806
791
807
## Claims Path Pointer {#claims_path_pointer}
792
808
@@ -2384,26 +2400,31 @@ Credential in the format `mso_mdoc` with the claims `vehicle_holder` and
2384
2400
2385
2401
<{{examples/query_lang/simple_mdoc.json}}
2386
2402
2387
-
The following is a non-normative example of a VP Query that requests
2388
-
2389
-
- the mandatory claims `last_name` and `date_of_birth`, and
2390
-
- either the claim `postal_code`, or both of the the claims `locality` and `region`, and
2391
-
- optionally the claim `email`.
2392
-
2393
-
<{{examples/query_lang/claims_alternatives.json}}
2394
-
2395
2403
The following is a non-normative example of a VP Query that requests multiple
2396
2404
Verifiable Credentials; all of them must be returned:
2397
2405
2398
2406
<{{examples/query_lang/multi_credentials.json}}
2399
2407
2400
-
The following shows a complex query where the Wallet is requested to deliver the `pid` credential, or the `other_pid` credential, or both `pid_reduced_cred_1` and `pid_reduced_cred_2`. Additionally, the `nice_to_have` credential may optionally be
2401
-
delivered. From the latter, the claim `legacy_system_rewards_number` may optionally
2402
-
be delivered.
2408
+
The following shows a complex query where the Wallet is requested to deliver the
2409
+
`pid` credential, or the `other_pid` credential, or both `pid_reduced_cred_1`
2410
+
and `pid_reduced_cred_2`. Additionally, the `nice_to_have` credential may
0 commit comments