From 5a20a6898a23771d6b1ab7f51946deb492fba15c Mon Sep 17 00:00:00 2001 From: Nikos Triantafyllou Date: Fri, 17 May 2024 10:26:40 +0300 Subject: [PATCH] corrected an issue with the verificatiton of sdjwtt --- data/presentation_definition.json | 2 +- package.json | 2 +- routes/routes.js | 4 +++- routes/verifierRoutes.js | 6 +++--- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/data/presentation_definition.json b/data/presentation_definition.json index 5c00ef1..76f1c8b 100644 --- a/data/presentation_definition.json +++ b/data/presentation_definition.json @@ -23,7 +23,7 @@ "path": ["$.last_name"] }, { - "path": ["$.type"], + "path": ["$.vct"], "filter": { "type": "string", "const": "VerifiablePortableDocumentA1" diff --git a/package.json b/package.json index 3100c8e..a90a6d2 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "type": "module", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", - "dev": "SERVER_URL=https://0a15-2a02-587-870e-d900-ed80-93f1-689f-839a.ngrok-free.app node server.js" + "dev": "SERVER_URL=https://4a82-2a02-587-8714-6000-389c-be54-a907-e4df.ngrok-free.app node server.js" }, "author": "", "license": "ISC", diff --git a/routes/routes.js b/routes/routes.js index 8a0bd81..3affc87 100644 --- a/routes/routes.js +++ b/routes/routes.js @@ -67,6 +67,8 @@ router.get(["/offer"], async (req, res) => { }); }); + + //pre-auth flow request sd-jwt router.get(["/credential-offer/:id"], (req, res) => { res.json({ @@ -82,7 +84,7 @@ router.get(["/credential-offer/:id"], (req, res) => { }); // *************** -///pre-auth flow jwt_ve +///pre-auth flow jwt_vc router.get(["/pre-offer-jwt"], async (req, res) => { const uuid = req.query.sessionId ? req.query.sessionId : uuidv4(); const preSessions = getPreCodeSessions(); diff --git a/routes/verifierRoutes.js b/routes/verifierRoutes.js index 7ea3cc9..b690902 100644 --- a/routes/verifierRoutes.js +++ b/routes/verifierRoutes.js @@ -21,7 +21,7 @@ const serverURL = process.env.SERVER_URL || "http://localhost:3000"; const privateKey = fs.readFileSync("./private-key.pem", "utf-8"); const publicKeyPem = fs.readFileSync("./public-key.pem", "utf-8"); -const presentation_definition = JSON.parse( +const presentation_definition_sdJwt = JSON.parse( fs.readFileSync("./data/presentation_definition.json", "utf-8") ); @@ -47,7 +47,7 @@ verifierRouter.get("/generateVPRequest", async (req, res) => { request_uri, stateParam, nonce, - encodeURIComponent(JSON.stringify(presentation_definition)) + encodeURIComponent(JSON.stringify(presentation_definition_sdJwt)) ); let code = qr.image(vpRequest, { @@ -90,7 +90,7 @@ verifierRouter.get("/vpRequest/:id", async (req, res) => { nonce, clientId, response_uri, - presentation_definition, + presentation_definition_sdJwt, jwks, serverURL, privateKey