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

Test JWT VC with single-element-array subject #313

Merged
merged 1 commit into from
Sep 30, 2021

Conversation

clehner
Copy link
Contributor

@clehner clehner commented Sep 28, 2021

When converting between the JWT subject ("sub" claim) and the VC credentialSubject, VC Data Model 1.0 only allows a single subject. (The "sub" value must be a StringOrURI: RFC 7519). When issuing a JWT VC, we allow the case where a credentialSubject is an array containing a single value (object with id property) as well as single object value. But when verifying such a JWT VC, this case was not handled, and an error "Unable to convert JWT claims to VC: Invalid subject for JWT" would result. This PR changes the conversion of JWT claims to Credential to support the case where the credentialSubject is an array containing a single element.

@clehner clehner marked this pull request as ready for review September 28, 2021 22:18
@clehner clehner requested a review from chunningham September 28, 2021 22:18
Copy link
Contributor

@chunningham chunningham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense, some of the language in the JWT encoding section of the spec implies that it would normally be a single object (referring to the "id property of credentialSubject"), but it's not actually specific and imo the spirit of it is that any vc-like object is fine. good corner case spotting

@clehner clehner force-pushed the fix/jwt-vc-single-elem-array-subj branch from 8955da6 to 809f242 Compare September 30, 2021 14:19
@clehner clehner merged commit 809f242 into main Sep 30, 2021
@clehner clehner deleted the fix/jwt-vc-single-elem-array-subj branch September 30, 2021 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants