Skip to content

Commit

Permalink
fix jwk
Browse files Browse the repository at this point in the history
  • Loading branch information
shihjay2 committed Jan 2, 2025
1 parent 65b45fa commit 6f66c0e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pages/api/vp/share.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
// const header = { alg: alg, kid: kid_did_final, typ: 'JWT' };
const nonce = uuidv4();
const state = uuidv4();
const jwk = createJWK("Ed25519", identifier.keys[0].publicKeyHex);
const payload = {
"iss": identifier.did,
"sub_jwk": jwk,
"aud": identifier.did,
"response_type": "vp_token id_token",
"scope": "openid",
Expand Down Expand Up @@ -105,7 +106,6 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
}
}
const signer = EdDSASigner(hexToBytes(identifier.keys[0].publicKeyHex));
const jwk = createJWK("Ed25519", identifier.keys[0].publicKeyHex);
const jwt = await createJWT(payload, {issuer: identifier.did, signer}, {alg: 'EdDSA', typ: 'JWT', jwk: jwk });
console.log(jwt)
console.log(payload)
Expand Down

0 comments on commit 6f66c0e

Please sign in to comment.