Commit a8df1eb5 authored by Fabian van den Broek's avatar Fabian van den Broek

birthdate verification option after successfull iDIN credential issueance

parent 9635b05c
......@@ -6,6 +6,14 @@
<link href="bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<script type="text/javascript" src="[IRMA_JS_URL]irma.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript" src="js/iDIN-verify.js"></script>
<script type="text/javascript">
var server = "[IDIN_SERVER_URL]/api/v1/idin";
</script>
<title>iDIN Attributen uitgegeven</title>
</head>
......@@ -23,9 +31,16 @@
</p>
<p>
Je kunt ze nu gebruiken op iedere website die deze attributen accepteert.
Je kunt ze nu gebruiken op iedere website die deze attributen accepteert.<br/>
Als je direct één van je nieuwe attributen wilt testen, druk dan op de onderstaande knop.
</p>
<button id="verify_idin_bd_btn" class="btn btn-primary">Test Attributes</button>
<h3 id="result_header"></h3>
<h4 id="result_status"></h4>
<p id="token-content"></p>
<a href="https://privacybydesign.foundation/irma/">Keer terug naar de Privacy by Design Foundation.</a>
</div>
</div>
......
$(function() {
var success_fun = function(data) {
$("#result_status").html("Success!");
$("#result_header").html("Resultaat");
var bd = jwt_decode(data).attributes["pbdf.pbdf.idinData.dateOfBirth"];
$("#token-content").html("<b>Uw geboortedatum is:</b> " + bd);
//TODO: check voor verjaardag
}
var cancel_fun = function(data) {
$("#result_header").html("Resultaat");
$("#result_status").html("Geannuleerd!");
}
var error_fun = function(data) {
console.log("De verificatie is niet gelukt!");
console.log("Error data:", data);
$("#result_header").html("Resultaat");
$("#result_status").html("Failure!");
}
$("#verify_idin_bd_btn").on("click", function() {
$("#result_header").text("");
$("#result_status").text("");
$("#token-content").text("");
$.ajax({
type: "GET",
url: server + "/verify",
success: function(data) {
IRMA.verify(data, success_fun, cancel_fun, error_fun);
},
error: showError,
});
IRMA.verify(jwt, success_fun, error_fun);
});
});
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment