Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add clientData #95

Closed
timcappalli opened this issue Apr 2, 2024 · 5 comments
Closed

Add clientData #95

timcappalli opened this issue Apr 2, 2024 · 5 comments
Assignees
Labels

Comments

@timcappalli
Copy link
Member

In WebAuthn, we have clientDataJSON and clientDataHash, which represent contextual bindings for both the relying party and client.

clientDataJSON is a JSON object containing properties enumerated by the WebAuthn client. This is then hashed (SHA-256), clientDataHash, and passed to the authenticator who then signs over it as part of the ceremony. The original clientDataJSON is passed back to the relying party by the client in the response.

For the Digital Credentials API, we need to get the origin from the web platform down to the app platform and over to the wallet. And as we consider cross-origin and iframe usage, topOrigin and crossOrigin become important properties. There have also been discussions around the client's TLS session context being valuable to a wallet (#46, #81). Therefore it may make sense to to have a clientData-like property in the Digital Credentials API.

Potential structure for clientDataJSON, inspired by WebAuthn:

{
  type: `${finalApiShortName}.presentation` || `${finalApiShortName}.issuance`,
  origin,
  topOrigin,
  crossOrigin,
  tlsContext: {
    subject: {},
    issuer,
    thumbprint   
  }
}

While issuance is not in scope for the initial work stream, we expect the API to also be used for invoking issuance at some point in the future, so it would be good to include type day 1.

@OR13
Copy link
Contributor

OR13 commented Apr 2, 2024

Can we see an example of this data structure in the context of the existing navigator APIs?
I'd especially like to make sense of the multiple certs use case, in the context of this.

@timcappalli
Copy link
Member Author

timcappalli commented Apr 2, 2024

Can we see an example of this data structure in the context of the existing navigator APIs?

[Exposed=Window, SecureContext]
interface DigitalCredential : Credential {
  readonly attribute DOMString protocol;
  readonly attribute DOMString data;
  // clientDataJSON is a Base64 encoded URL String
  readonly attribute DOMString clientDataJSON;
};

@timcappalli
Copy link
Member Author

Question for discussion in the F2F/hybrid meeting: should we put a hash of the request object into clientData? Otherwise there is nothing to correlate in clientData.

In WebAuthn, the challenge is included in clientData. For the DC API, any nonce or state is part of the request properties.

@timcappalli
Copy link
Member Author

Outcome from 2024-06-21 hybrid meeting discussion: add clientData without TLS session context and with hash of the request object.

https://github.com/WICG/digital-credentials/wiki/2024-06-21-Hybrid-Meeting-Notes#spec-items-clientdata-payload-95

@timcappalli timcappalli changed the title Should we add a clientData like object? Add clientData Jun 26, 2024
@timcappalli timcappalli self-assigned this Jun 26, 2024
@timcappalli
Copy link
Member Author

From editor's discussion:

clientData would be valuable if the wallet had to sign over this data as part of their presentation. Since that is not required in OID4VP, adding this would only be for development convenience as type is inferred based on the request, crossOrigin and topOrigin can be inferred, and origin is always provided.

Can discuss again in the future. Closing issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants