Skip to content

Commit

Permalink
updated vp request with iss/aud and also vp_format in client metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
endimion committed Nov 7, 2024
1 parent 62240f4 commit 2a20f5f
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 6 deletions.
22 changes: 17 additions & 5 deletions routes/codeFlowSdJwtRoutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,11 @@ codeFlowRouterSDJWT.get("/x509VPrequest_dynamic/:id", async (req, res) => {
location: "Greece",
cover_uri: "string",
description: "EWC pilot case verification",
vp_formats: {
"vc+sd-jwt": {
alg: ["ES256", "ES384"],
},
},
};
const presentation_definition_sdJwt = JSON.parse(
fs.readFileSync("./data/presentation_definition_sdjwt.json", "utf-8")
Expand All @@ -394,7 +399,9 @@ codeFlowRouterSDJWT.get("/x509VPrequest_dynamic/:id", async (req, res) => {
presentation_definition_sdJwt,
"",
"x509_san_dns",
client_metadata, null, serverURL
client_metadata,
null,
serverURL
);

console.log(signedVPJWT);
Expand All @@ -411,6 +418,11 @@ codeFlowRouterSDJWT.get("/didJwksVPrequest_dynamic/:id", async (req, res) => {
location: "Greece",
cover_uri: "string",
description: "EWC pilot case verification",
vp_formats: {
"vc+sd-jwt": {
alg: ["ES256", "ES384"],
},
},
};

const privateKeyPem = fs.readFileSync(
Expand All @@ -420,9 +432,9 @@ codeFlowRouterSDJWT.get("/didJwksVPrequest_dynamic/:id", async (req, res) => {

let contorller = serverURL;
if (proxyPath) {
contorller = serverURL.replace("/"+proxyPath,"") + ":" + proxyPath;
contorller = serverURL.replace("/" + proxyPath, "") + ":" + proxyPath;
}
contorller = contorller.replace("https://","")
contorller = contorller.replace("https://", "");
const clientId = `did:web:${contorller}`;
const presentation_definition_sdJwt = JSON.parse(
fs.readFileSync("./data/presentation_definition_sdjwt.json", "utf-8")
Expand Down Expand Up @@ -475,7 +487,7 @@ codeFlowRouterSDJWT.post("/direct_post_vci/:id", async (req, res) => {
// );

let sessionIndex = codeSessions.sessions.indexOf(uuid);

if (sessionIndex >= 0) {
let issuanceState = codeSessions.results[sessionIndex].state;

Expand All @@ -495,7 +507,7 @@ codeFlowRouterSDJWT.post("/direct_post_vci/:id", async (req, res) => {

const redirectUrl = `${codeSessions.requests[sessionIndex].redirectUri}?code=${authorizationCode}&state=${issuanceState}`;
// return //res.redirect(302, redirectUrl);
return res.send({redirect_uri: redirectUrl });
return res.send({ redirect_uri: redirectUrl });
} else {
console.log("issuance session not found " + uuid);
return res.sendStatus(500);
Expand Down
17 changes: 16 additions & 1 deletion routes/verifierRoutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,14 @@ verifierRouter.get("/x509VPrequest/:id", async (req, res) => {
location: "Greece",
cover_uri: "string",
description: "EWC pilot case verification",
vp_formats:
vp_formats: {
jwt_vp: {
alg: ["EdDSA", "ES256K"],
},
ldp_vp: {
proof_type: ["Ed25519Signature2018"],
},
}
};

const clientId = "dss.aegean.gr";
Expand Down Expand Up @@ -296,6 +303,14 @@ verifierRouter.get("/didjwks/:id", async (req, res) => {
location: "Greece",
cover_uri: "string",
description: "EWC pilot case verification",
vp_formats: {
jwt_vp: {
alg: ["EdDSA", "ES256K"],
},
ldp_vp: {
proof_type: ["Ed25519Signature2018"],
},
}
};

let privateKeyPem = fs.readFileSync(
Expand Down

0 comments on commit 2a20f5f

Please sign in to comment.