Skip to content

Commit 6f66c0e

Browse files
committed
fix jwk
1 parent 65b45fa commit 6f66c0e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pages/api/vp/share.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
3535
// const header = { alg: alg, kid: kid_did_final, typ: 'JWT' };
3636
const nonce = uuidv4();
3737
const state = uuidv4();
38+
const jwk = createJWK("Ed25519", identifier.keys[0].publicKeyHex);
3839
const payload = {
39-
"iss": identifier.did,
40+
"sub_jwk": jwk,
4041
"aud": identifier.did,
4142
"response_type": "vp_token id_token",
4243
"scope": "openid",
@@ -105,7 +106,6 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
105106
}
106107
}
107108
const signer = EdDSASigner(hexToBytes(identifier.keys[0].publicKeyHex));
108-
const jwk = createJWK("Ed25519", identifier.keys[0].publicKeyHex);
109109
const jwt = await createJWT(payload, {issuer: identifier.did, signer}, {alg: 'EdDSA', typ: 'JWT', jwk: jwk });
110110
console.log(jwt)
111111
console.log(payload)

0 commit comments

Comments
 (0)