Skip to content

Commit

Permalink
bug fix for redirectUrl during code flow
Browse files Browse the repository at this point in the history
  • Loading branch information
endimion committed Apr 19, 2024
1 parent 0ba9315 commit 1487b48
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 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://e756-2a02-587-8716-3600-5055-a1a8-76c2-c9a6.ngrok-free.app node server.js"
"dev": "SERVER_URL=https://5e40-2a02-587-8716-3600-20a7-3d19-b22b-ca04.ngrok-free.app node server.js"
},
"author": "",
"license": "ISC",
Expand Down
9 changes: 7 additions & 2 deletions routes/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
pemToJWK,
generateNonce,
base64UrlEncodeSha256,
buildVpRequestJwt
} from "../utils/cryptoUtils.js";
import {
buildAccessToken,
Expand Down Expand Up @@ -220,8 +221,9 @@ router.get("/authorize", async (req, res) => {


//5.1.5. Dynamic Credential Request https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0-12.html#name-successful-authorization-re
const redirectUrl = `http://localhost:8080?state=${state}&client_id=${clientId}&redirect_uri=${serverURL}/direct_post_vci&response_type=id_token&
response_mode=direct_post&scope=openid&nonce=${nonce}&request_uri=http://localhost:8080`
const request_uri = buildVpRequestJwt(state,nonce,clientId,"response_uri",null,"jwk",serverURL,privateKey);
const redirectUrl = `http://localhost:8080?state=${state}&client_id=${clientId}&redirect_uri=${serverURL}/direct_post_vci&response_type=id_token&response_mode=direct_post&scope=openid&nonce=${nonce}&request=${request_uri}`



if (errors.length > 0) {
Expand All @@ -241,6 +243,9 @@ router.get("/authorize", async (req, res) => {
}
});




router.post("/direct_post_vci", async (req, res) => {
console.log("direct_post VP for VCI is below!");
let state = req.body["state"]
Expand Down

0 comments on commit 1487b48

Please sign in to comment.