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

Dedicated Docs for JWT and VC JWTs #135

Open
nitro-neal opened this issue Mar 20, 2024 · 2 comments
Open

Dedicated Docs for JWT and VC JWTs #135

nitro-neal opened this issue Mar 20, 2024 · 2 comments
Assignees
Labels
testing related to new or existing tests vc related to verifiable credentials

Comments

@nitro-neal
Copy link
Contributor

Clarify:
https://www.w3.org/TR/vc-data-model/#jwt-decoding
Originally from https://github.com/TBD54566975/web5-js/pull/421/files

Clarify the language and vc jwt examples for these claims:

  • If any of these steps fail, the function will throw a [Error] with a message indicating the nature of the failure:

    • exp MUST represent the expirationDate property, encoded as a UNIX timestamp (NumericDate).
    • iss MUST represent the issuer property of a verifiable credential or the holder property of a verifiable presentation.
    • nbf MUST represent issuanceDate, encoded as a UNIX timestamp (NumericDate).
    • jti MUST represent the id property of the verifiable credential or verifiable presentation.
    • sub MUST represent the id property contained in the credentialSubject.
  • Once the verifications are successful, when recreating the VC data model object, this function will:

    • If exp is present, the UNIX timestamp MUST be converted to an [XMLSCHEMA11-2] date-time, and MUST be used to set the value of the expirationDate property of credentialSubject of the new JSON object.
    • If iss is present, the value MUST be used to set the issuer property of the new credential JSON object or the holder property of the new presentation JSON object.
    • If nbf is present, the UNIX timestamp MUST be converted to an [XMLSCHEMA11-2] date-time, and MUST be used to set the value of the issuanceDate property of the new JSON object.
    • If sub is present, the value MUST be used to set the value of the id property of credentialSubject of the new credential JSON object.
    • If jti is present, the value MUST be used to set the value of the id property of the new JSON object.
@KendallWeihe
Copy link
Contributor

Also relevant to this #134

@decentralgabe I think we need dedicated docs around JWT thangs, like we did for VCs and DIDs

@decentralgabe decentralgabe added testing related to new or existing tests vc related to verifiable credentials labels Aug 16, 2024
@decentralgabe
Copy link
Member

@nitro-neal do you believe the guidance in the spec is sufficient?

if not, would you like to add text that helps clarify this? and test vectors to match? please add to #168

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing related to new or existing tests vc related to verifiable credentials
Projects
None yet
Development

No branches or pull requests

3 participants