digital-credentials icon indicating copy to clipboard operation
digital-credentials copied to clipboard

Expressing requested claims in the Verifiable Credentials example

Open Sakurann opened this issue 2 years ago • 2 comments

for a verifiable credential example,if a credential format is specified (vc+sd-jwt in your example), there is no need to provide a JSON.Path to different potential variations of how a claim name can be expressed, because "the path" where to find a claim name will be determined by the credential format and credential type.

Could a structure like below be sufficient?

// Gets a SD-JWT from a VC holder.
const {response} = await navigator.credentials.get({
  identity: {
    providers: [{
      vc: {
        nonce: "m5tGxUIsFtLi6pwg",
        format: { 
            vc+sd-jwt: { 
                alg: ["EdDSA", "ES256"]
            }
         },
         type: "UniversityDegreeCredential",
         credentialSubject: {
             family_name: {
	         intent_to_retain: false
              },
             birth_date: {
		   mandatory: true,
             },
             driving_privileges: {
             } 
         }
      }
    }]
  }
});

Sakurann avatar Apr 28 '23 05:04 Sakurann

Could a structure like below be sufficient?

Yeah, I do think a variation of this structure would be possible. Here is how we could accomplish this in more WebIDL-friendly terms:

// Gets a SD-JWT from a VC holder.
const {response} = await navigator.credentials.get({
  identity: {
    providers: [{
      vc: {
        params: {
          nonce: "m5tGxUIsFtLi6pwg",
        },
        selector: {
          format: {
              type: "vc+sd-jwt",
              alg: ["EdDSA", "ES256"]
           },
           type: "UniversityDegreeCredential",
           credentialSubject: {
               family_name: { 
	         intent_to_retain: false
               },
               birth_date: {
		 mandatory: true,
               },
               driving_privileges: {
               } 
           }
        }
      }]
    }
  }
});

WDYT?

samuelgoto avatar Sep 29 '23 17:09 samuelgoto

@samuelgoto, as this refers to an old proposal, should we close this out?

At the same time, it would be great to start thinking about adding some examples of usage to the spec. Would be great to collaborate with @Sakurann on one or more.

We should probably add examples as we add things to the registry (#58)

marcoscaceres avatar Jan 25 '24 04:01 marcoscaceres

i think you can close this one since it uses the old proposal.

happy to help with the examples. let me know where is the best place.

Sakurann avatar Aug 01 '24 18:08 Sakurann