Skip to content

Commit

Permalink
issue with sig header for sd-jwt
Browse files Browse the repository at this point in the history
  • Loading branch information
endimion committed Sep 10, 2024
1 parent 48edfc1 commit 6749a71
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 10 deletions.
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://dd0d-2a02-587-8713-1c00-f2ea-680b-e09-62ed.ngrok-free.app node server.js"
"dev": "SERVER_URL=https://cf55-2a02-587-870d-e900-a1b1-2ac9-eea6-a3b6.ngrok-free.app node server.js"
},
"author": "",
"license": "ISC",
Expand Down
29 changes: 21 additions & 8 deletions routes/codeFlowJwtRoutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,29 @@ codeFlowRouter.get("/authorize", async (req, res) => {

//validations
let errors = [];
/*
[{"format":"jwt_vc",
"locations":["https://issuer.example.com"],
"type":"openid_credential",
"types":["VerifiableCredential","VerifiableAttestation","VerifiablePortableDocumentA1"]}]
*/
if (!authorizationDetails) {
//errors.push("no credentials requested");
errors.push("no credentials requested");
console.log(`no credentials requested`);
} else if (authorizationDetails.credential_definition) {
console.log(
`credential ${authorizationDetails.credential_definition.type} was requested`
);
} else if (authorizationDetails.types) {
//EBSI style
console.log(`credential ${authorizationDetails.types} was requested`);
} else {
try{
if (authorizationDetails.credential_definition) {
console.log(
`credential ${authorizationDetails.credential_definition.type} was requested`
);
} else if (authorizationDetails.types) {
//EBSI style
console.log(`credential ${authorizationDetails.types} was requested`);
}
}catch(error){
errors.push("no credentials requested");
}

}

if (responseType !== "code") {
Expand Down
2 changes: 1 addition & 1 deletion routes/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ router.post("/credential", async (req, res) => {
const sdjwt = new SDJwtVcInstance({
signer,
verifier,
signAlg: "ES384",
signAlg: "ES256",
hasher: digest,
hashAlg: "SHA-256",
saltGenerator: generateSalt,
Expand Down

0 comments on commit 6749a71

Please sign in to comment.