diff --git a/package.json b/package.json index 7a7f699..34650d2 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://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", diff --git a/routes/codeFlowJwtRoutes.js b/routes/codeFlowJwtRoutes.js index 0ffaa0f..83b8c59 100644 --- a/routes/codeFlowJwtRoutes.js +++ b/routes/codeFlowJwtRoutes.js @@ -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") { diff --git a/routes/routes.js b/routes/routes.js index 5a36abb..7116fdb 100644 --- a/routes/routes.js +++ b/routes/routes.js @@ -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,