Skip to content

Commit

Permalink
corrected an issue with the verificatiton of sdjwtt
Browse files Browse the repository at this point in the history
  • Loading branch information
endimion committed May 17, 2024
1 parent 6cf9264 commit 5a20a68
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion data/presentation_definition.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"path": ["$.last_name"]
},
{
"path": ["$.type"],
"path": ["$.vct"],
"filter": {
"type": "string",
"const": "VerifiablePortableDocumentA1"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 3 additions & 1 deletion routes/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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();
Expand Down
6 changes: 3 additions & 3 deletions routes/verifierRoutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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")
);

Expand All @@ -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, {
Expand Down Expand Up @@ -90,7 +90,7 @@ verifierRouter.get("/vpRequest/:id", async (req, res) => {
nonce,
clientId,
response_uri,
presentation_definition,
presentation_definition_sdJwt,
jwks,
serverURL,
privateKey
Expand Down

0 comments on commit 5a20a68

Please sign in to comment.