|
97 | 97 | throw new Error("cred_uid is not available. Please start the task first.");
|
98 | 98 | }
|
99 | 99 |
|
| 100 | + // the verifier's challenge |
| 101 | + const challenge = document.getElementById("challengeInput").value; |
| 102 | + |
100 | 103 | // the disclosure UID associated with the credential
|
101 | 104 | const disclosure_UID = document.getElementById("disclosureUidSelect").value;
|
102 |
| - const showResponse = await fetch(`${clientHelperUrl}/show?cred_uid=${cred_uid}&disc_uid=${disclosure_UID}`); |
| 105 | + const showResponse = await fetch(`${clientHelperUrl}/show?cred_uid=${cred_uid}&disc_uid=${disclosure_UID}&challenge=${challenge}`); |
103 | 106 | if (!showResponse.ok) {
|
104 | 107 | throw new Error('Failed to fetch Show Proof');
|
105 | 108 | }
|
|
109 | 112 |
|
110 | 113 | // Display the test command in the textarea
|
111 | 114 | const schema_uid = document.getElementById("schemaUidInput").value;
|
112 |
| - const test_command = `wget --method=POST --body-data='{"schema_uid":"${schema_uid}", "issuer_url":"http://127.0.0.1:8001", "proof":"${show_proof_b64}", "disclosure_uid":"${disclosure_UID}"}' --header='Content-Type: application/json' --server-response --max-redirect=3 -d http://127.0.0.1:8004/verify -O- --no-verbose`; |
| 115 | + const test_command = `wget --method=POST --body-data='{"schema_uid":"${schema_uid}", "issuer_url":"http://127.0.0.1:8001", "proof":"${show_proof_b64}", "disclosure_uid":"${disclosure_UID}", "session_id":"${challenge}"}' --header='Content-Type: application/json' --server-response --max-redirect=3 -d http://127.0.0.1:8004/verify -O- --no-verbose`; |
113 | 116 | document.getElementById('testCommand').value = test_command;
|
114 | 117 | console.log(test_command);
|
115 | 118 | } catch (error) {
|
@@ -162,6 +165,8 @@ <h2>ShowData (OPTIONAL)</h2>
|
162 | 165 | <div>
|
163 | 166 | <h2>Show Proof:</h2>
|
164 | 167 | <p>Click "Show Credential" to fetch the proof for the credential.</p>
|
| 168 | + <label for="challengeInput">Verifier challenge (from the meta tag "crescent_challenge" value):</label><br> |
| 169 | + <input type="text" id="challengeInput" size="80" value=""><br> |
165 | 170 | <label for="disclosureUidSelect">Disclosure UID:</label>
|
166 | 171 | <select id="disclosureUidSelect">
|
167 | 172 | <option value="crescent://email_domain">crescent://email_domain</option>
|
|
0 commit comments