Skip to content

Commit 3ab6775

Browse files
Merge branch 'main' into corrdinator
2 parents 9795095 + 4624c60 commit 3ab6775

File tree

4 files changed

+32
-74
lines changed

4 files changed

+32
-74
lines changed

README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,7 @@ This project covers the requesting mechanisms for digital credentials, including
1414

1515
## Trying out the API
1616

17-
**🚧 Note: The API is still extremely unstable and undergoing a lot of changes (almost daily!). 🚧**
18-
19-
However, if you want to try it out:
20-
21-
- [Try out the API in Chrome](https://digitalcredentials.dev/docs/requirements/)
17+
[Try out the API in Chrome](https://digitalcredentials.dev/docs/requirements/)
2218

2319
## Contributing
2420

explainer.md

Lines changed: 1 addition & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -32,64 +32,7 @@ To balance this tension we propose an API with the following key properties:
3232

3333
At its core, the API is designed for a website ("verifier") to [transparently](https://github.com/w3cping/credential-considerations/blob/main/credentials-considerations.md#in-context-explanations) request the [selective disclosure](https://github.com/w3cping/credential-considerations/blob/main/credentials-considerations.md#selective-disclosure) of attributes from (issued) digital credentials that were provisioned - ahead of time - to wallets ("holders"), in a manner that is seamlessly compatible with existing architectural choices (such as [OpenID4VP integration](https://github.com/openid/OpenID4VP/issues/125)).
3434

35-
Here is an example of how the  the API might be used in practice:
36-
37-
The API needs to be initiated through a user gesture, such as a button click:
38-
39-
```html
40-
<button onclick="requestCredential()">Request Driver's license<button>
41-
```
42-
43-
44-
```javascript
45-
async function requestCredential() {
46-
47-
// Check for Digital Credentials API support
48-
if (typeof window.DigitalCredential !== 'undefined') {
49-
50-
try {
51-
52-
// These parameters are typically fetched from the backend.
53-
// Statically defined here for protocol extensibility illustration purposes.
54-
const oid4vp = {
55-
protocol: "oid4vp", // An example of an OpenID4VP request to wallets. // Based on https://github.com/openid/OpenID4VP/issues/125
56-
data: {
57-
nonce: "n-0S6_WzA2Mj",
58-
presentation_definition: {
59-
//Presentation Exchange request, omitted for brevity
60-
},
61-
},
62-
};
63-
64-
// create an Abort Controller
65-
const controller = new AbortController();
66-
67-
// Call the Digital Credentials API using the presentation request from the backend
68-
let dcResponse = await navigator.credentials.get({
69-
signal: controller.signal,
70-
mediation: "required",
71-
digital: {
72-
requests: [ oid4vp ]
73-
}
74-
});
75-
76-
// Send the encrypted response to the backend for decryption and verification
77-
// Ommitted for brevity
78-
79-
} catch (error) {
80-
console.error('Error:', error);
81-
}
82-
} else {
83-
84-
// fallback scenario, illustrative only
85-
alert("The Digital Credentials API is not supported in this browser.")
86-
}
87-
};
88-
```
89-
90-
> Example from: https://digitalcredentials.dev/docs/verifier-site/requesting-cred
91-
92-
You can read a more detailed and technical description of the API in the [specification draft](https://w3c-fedid.github.io/digital-credentials/).
35+
For an [example of how to use the API](https://w3c-fedid.github.io/digital-credentials/#example-requesting-a-digital-credential) and a more detailed technical description, please refer to the [specification draft](https://www.w3.org/TR/digital-credentials/).
9336

9437
### Using the API from another origin
9538

horizontal-reviews/security-privacy.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
> 01. What information does this feature expose,
44
> and for what purposes?
55
6-
High-value privacy sensitive claims from digital credentials, such as digital driver's licenses for both unique identification (such as for access to government services) and selective disclosure (such as for age verification). It does this through a one-time user-mediated communication channel from websites, to digital wallet applications, and back to websites. It is designed to be a better option than established lower-level communication channels like custom schemes, QR codes, and server-to-server network communication. How exactly this channel is used is up to the wallet applications and host operating system.
6+
Potentially high-value, privacy-sensitive claims from digital credentials, such as both unique identification (such as for access to government services) and selective disclosures (such as for age verification) from digital driver's licenses. These requests are made from websites, to digital wallet applications, and back to websites, through user-mediated, one-time communication channels. These are designed to be better options than established lower-level communication channels like custom schemes, QR codes, and server-to-server network communications. A website can decide which information to request. A request can be inspected by the user agent, and the specification recommends that the information being requested be disclosed to the user in the permission prompt. The wallet application decides which information is actually shared, based upon the request.
77

88
> 02. Do features in your specification expose the minimum amount of information
99
> necessary to implement the intended functionality?
1010
1111
A primary use case of the digital credentials API is to enable users to selectively disclose only the minimum required information, such as a cryptographic attestation that the user holds a California driver’s license for an adult. The use of selective disclosure, however, is a decision for the verifier website based on the use case. There are legitimate scenarios, such as creating or recovering an account on a government website, where uniquely identifiable and potentially non-resettable personally identifiable information (PII) might be exposed.
1212

13-
The API is designed to expect the use of response encryption so that this PII is exposed only to the requesting server and not any code running in the web page or browser. It is an [open question](https://github.com/WICG/digital-identities/issues/109) whether this response encryption is something we can reasonably enforce at this layer or not.
13+
The API is designed to expect the use of response encryption so that this PII is exposed only to the requesting server, such that exposure to code running in the web page or browser can be minimized or even avoided. It is an [open question](https://github.com/WICG/digital-identities/issues/109) whether this response encryption is something we can reasonably enforce at this layer.
1414

15-
The API is also designed to require request transparency to enable user agents and operating systems to appropriately inform users about the level of privacy risk involved in the request. A major area of outstanding work is to outline in the specification our privacy and security guidance to implementers, but we already know that the [Chromium implementation](https://docs.google.com/document/d/1L68tmNXCQXucsCV8eS8CBd_F9FZ6TNwKNOaFkA8RfwI/edit) intends to show users stronger warnings in riskier scenarios such as those that lack the use of selective disclosure.
15+
The API is also designed to require request transparency to enable user agents and operating systems to appropriately inform users about the level of privacy risk involved in the request. The specification has a set of recommendations ([1](https://www.w3.org/TR/digital-credentials/latest/#user-permission-and-transparency), [2](https://www.w3.org/TR/digital-credentials/latest/#mitigating-unnecessary-requests-for-government-credentials), [3](https://www.w3.org/TR/digital-credentials/latest/#mitigating-unnecessary-requests-for-non-government-credentials)) for implementers, describing how to appropriately inform users about the credentials being exchanged. For example, the [Chromium implementation](https://docs.google.com/document/d/1L68tmNXCQXucsCV8eS8CBd_F9FZ6TNwKNOaFkA8RfwI/edit) intends to show users stronger warnings in riskier scenarios such as those that do not support selective disclosure.
1616

1717
> 03. Do the features in your specification expose personal information,
1818
> personally-identifiable information (PII), or information derived from
@@ -40,7 +40,7 @@ Further, this specification aims to be an improvement over the existing communic
4040
> 05. Do the features in your specification introduce state
4141
> that persists across browsing sessions?
4242
43-
No. In particular, the current scope is just about credential presentation (read-only). We have had requests to expand scope to consider credential issuance APIs but no work has begun on that.
43+
Yes. The specification includes [a facility](https://w3c-fedid.github.io/digital-credentials/#create-origin-options-sameoriginwithancestors-internal-method) for issuing new credentials into wallets with user permission.
4444

4545
> 06. Do the features in your specification expose information about the
4646
> underlying platform to origins?
@@ -63,7 +63,7 @@ No.
6363

6464
> 10. Do features in this specification allow an origin to access other devices?
6565
66-
Not yet, but we expect to expand the API to enable cross-device presentation flows using the same mechanism used by passkeys ([FIDO CTAP](https://fidoalliance.org/specs/fido-v2.2-rd-20230321/fido-client-to-authenticator-protocol-v2.2-rd-20230321.html)).
66+
Potentially, yes. While not a property of the DC API itself, the API is designed to support cross-device presentation flows such as by using the [FIDO CTAP](https://fidoalliance.org/specs/fido-v2.2-rd-20230321/fido-client-to-authenticator-protocol-v2.2-rd-20230321.html) used by passkeys.
6767

6868
> 11. Do features in this specification allow an origin some measure of control over
6969
> a user agent's native UI?
@@ -78,7 +78,7 @@ None directly. Wallets may expose temporary identifiers, such as in the MSOs use
7878
> 13. How does this specification distinguish between behavior in first-party and
7979
> third-party contexts?
8080
81-
The API is currently available only in first-party contexts, but there is an [open issue](https://github.com/WICG/digital-identities/issues/78) to explore adding a permission policy to enable requests in third-party contexts.
81+
The specification uses a Permissions Policy with the "self" default allow list, meaning the API cannot be used in third-party contexts unless allowed by the (recursive) parent context(s).
8282

8383
> 14. How do the features in this specification work in the context of a browser’s
8484
> Private Browsing or Incognito mode?
@@ -88,7 +88,9 @@ Like other browser authentication (e.g., WebAuthn) and identification (e.g., aut
8888
> 15. Does this specification have both "Security Considerations" and "Privacy
8989
> Considerations" sections?
9090
91-
Not yet, but it will. The specification is still being written as we incubate the API and gain experience with real-world experiments.
91+
The specification has [extensive Privacy considerations](https://w3c-fedid.github.io/digital-credentials/#privacy-considerations), most of which are still evolving as the group works through the many Privacy-related challenges of the digital credentials space.
92+
93+
There are [some early outlines for the Security Considerations](https://w3c-fedid.github.io/digital-credentials/#security-considerations), and there is active work in progress to write those up in more detail.
9294

9395
> 16. Do features in your specification enable origins to downgrade default
9496
> security protections?
@@ -99,13 +101,13 @@ No
99101
> (instead of getting destroyed) after navigation, and potentially gets reused
100102
> on future navigations back to the document?
101103
102-
Implementations should fail or postpone any requests which occur while the page is not visible to the user. The spec may introduce a [requirement for user activation](https://github.com/WICG/digital-identities/issues/91) which could help with this.
104+
Implementations should fail or postpone any requests which are made while the page is not visible to the user. The spec [requires](https://www.w3.org/TR/digital-credentials/latest/#discoverfromexternalsource-origin-options-sameoriginwithancestors-internal-method) both user attention on a fully active document and user activation to use the API.
103105

104106
> 18. What happens when a document that uses your feature gets disconnected?
105107
106-
Probably just silently ignored, but [we'll discuss](https://github.com/WICG/digital-identities/issues/112).
108+
See above. The spec has "fully active" checks in its algorithms.
107109

108110
> 19. What should this questionnaire have asked?
109111
110-
What are the security and privacy implications of not shipping this feature? How does this feature fit into the larger privacy risk landscape. We believe the feature will lead to a reduced risk relative to the status quo, but this is very subjective and hard to demonstrate definitively.
112+
What are the security and privacy implications of not shipping this feature? How does this feature fit into the larger privacy risk landscape? We believe this feature will offer reduced risks, relative to large-scale adoption of alternative technologies.
111113

index.html

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ <h3>
552552
</h3>
553553
<pre class="idl">
554554
dictionary DigitalCredentialRequestOptions {
555-
sequence&lt;DigitalCredentialGetRequest&gt; requests;
555+
required sequence&lt;DigitalCredentialGetRequest&gt; requests;
556556
};
557557
</pre>
558558
<h4>
@@ -689,6 +689,7 @@ <h3>
689689
<pre class="idl">
690690
[Exposed=Window, SecureContext]
691691
interface DigitalCredential : Credential {
692+
[Default] object toJSON();
692693
readonly attribute DOMString protocol;
693694
[SameObject] readonly attribute object data;
694695
static boolean userAgentAllowsProtocol(DOMString protocol);
@@ -784,6 +785,14 @@ <h3>
784785
</li>
785786
<li>If |requests| is empty, [=exception/throw=] a {{TypeError}}.
786787
</li>
788+
<li>[=List/For each=] |request| of |requests|:
789+
<ol>
790+
<li>[=serialize a JavaScript value to a JSON string|Serialize=]
791+
|request| to a JSON string. [=exception/throw|Re-throw=] any
792+
[=exception=].
793+
</li>
794+
</ol>
795+
</li>
787796
<li>
788797
<aside class="issue">
789798
Details of how to actually get the [=digital credential=] are
@@ -833,6 +842,14 @@ <h3>
833842
</li>
834843
<li>If |requests| is empty, [=exception/throw=] a {{TypeError}}.
835844
</li>
845+
<li>[=List/For each=] |request| of |requests|:
846+
<ol>
847+
<li>[=serialize a JavaScript value to a JSON string|Serialize=]
848+
|request| to a JSON string. [=exception/throw|Re-throw=] any
849+
[=exception=].
850+
</li>
851+
</ol>
852+
</li>
836853
<li>
837854
<aside class="issue">
838855
Details of how to actually issue the [=digital credential=] are

0 commit comments

Comments
 (0)