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 correct payload to SDJwtVcInstance #189

Open
cre8 opened this issue Apr 1, 2024 · 1 comment
Open

Add correct payload to SDJwtVcInstance #189

cre8 opened this issue Apr 1, 2024 · 1 comment

Comments

@cre8
Copy link
Contributor

cre8 commented Apr 1, 2024

When decoding an sd-jwt-vc credential with

const sdjwtvc = await sdjwt.decode(credential.credential as string);
console.log(sdjwtvc.jwt!.payload!.jti);

it will throw an error that jti comes from an index signature. It would be correct that we pass SdJwtVcPayload to the decode function so it knows that the default values from a JWT can be set.

Current solution is to cast it manually like console.log((sdjwtvc.jwt!.payload as SdJwtVcPayload).jti);

According to the SD-JWT-VC spec, jti is not a known value, but according to the JWT spec it is. Should we also add all values that are in a JWT also to the payload of a Sdjwtvc? Of course marking them all as optional.

@lukasjhan
Copy link
Member

@cre8 I think it would be better to include the JWT spec.
It would be inconvenient to use it by casting.

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

No branches or pull requests

2 participants