Sphereon-Opensource / SIOP-OID4VP

Self Issued OpenID Provider v2 (SIOP) with optional OpenID for Verifiable Presentations (OpenID4VP)
77 stars 25 forks source link

Update example in README #18

Closed honungsburk closed 1 year ago

honungsburk commented 1 year ago

reqURI.nonce doesn't exist nor does reqURI.state

Old example:

const reqURI = await rp.createAuthenticationRequest({
    nonce: "qBrR7mqnY3Qr49dAZycPF8FzgE83m6H0c2l0bzP4xSg",
    state: "b32f0087fc9816eb813fd11f"
});

console.log(`nonce: ${reqURI.nonce}, state: ${reqURI.state}`);
// nonce: qBrR7mqnY3Qr49dAZycPF8FzgE83m6H0c2l0bzP4xSg, state: b32f0087fc9816eb813fd11f

console.log(reqURI.encodedUri)
// openid://?response_type=id_token&scope=openid&client_id=did.......&jwt=ey..........

Updated example:

const reqURI = await rp.createAuthenticationRequest({
    nonce: "qBrR7mqnY3Qr49dAZycPF8FzgE83m6H0c2l0bzP4xSg",
    state: "b32f0087fc9816eb813fd11f"
});

 console.log(
    `nonce: ${reqURI.requestOpts.nonce}, state: ${reqURI.requestOpts.state}`
  );
// nonce: qBrR7mqnY3Qr49dAZycPF8FzgE83m6H0c2l0bzP4xSg, state: b32f0087fc9816eb813fd11f

console.log(reqURI.encodedUri)
// openid://?response_type=id_token&scope=openid&client_id=did.......&jwt=ey..........
nklomp commented 1 year ago

Hi @honungsburk Thanks for the update. We will definitely take these into account with the refactoring and updates to latest spec we are currently doing and getting this lib from an alpha to a beta state

nklomp commented 1 year ago

I updated the example in the mean time, although it will probably change soon. Thanks for reporting.