Commit 5db2d378 authored by Fabian van den Broek's avatar Fabian van den Broek
Browse files

working iDIN-test issuance

parent beee08dc
......@@ -4,7 +4,11 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta value="https://demo.irmacard.org/tomcat/irma_api_server/server/" name="irma-web-server">
<meta value="https://demo.irmacard.org/tomcat/irma_api_server/api/v2/" name="irma-api-server">
<link href="css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="https://privacybydesign.foundation/tomcat/irma_api_server/bower_components/jwt-decode/build/jwt-decode.js"></script>
<script type="text/javascript" src="https://privacybydesign.foundation/tomcat/irma_api_server/client/irma.js"></script>
<script type="text/javascript" src="js.cookie.js"></script>
......
$(function() {
//TODO: make an array over which to loop
addTableLine("stad",Cookies.get("city"));
var attributes = [["stad","city"],["naam","name"]];
$.each(attributes, function(){
if (this !== null && this[0] !== null && this[1] !== null) {
var value = Cookies.get(this[1]);
if (value!==undefined) {
console.log("??"+value);
addTableLine(this[0], value);
}
}
});
function addTableLine(head, data){
console.log("addLine");
$('#attributeTable')
.append($('<tr>')
.append($('<th>').text(head).attr("scope","row"))
if (data !== null) {
$('#attributeTable')
.append($('<tr>')
.append($('<th>').text(head).attr("scope", "row"))
.append($('<td>').text(data)
)
);
);
}
}
function showError(message) {
$("#alert_box").html("<div class=\"alert alert-danger\" role=\"alert\">"
+ "<strong>" + message + "</strong></div>");
}
var showWarning = function(msg) {
$("#alert_box").html("<div class=\"alert alert-warning\" role=\"alert\">"
+ "<strong>Warning:</strong> " + msg + "</div>");
};
var showSuccess = function(msg) {
$("#alert_box").html("<div class=\"alert alert-success\" role=\"alert\">"
+ msg + "</div>");
};
$("#enroll").on("click", function() {
// Clear errors
$(".form-group").removeClass("has-error");
$("#alert_box").empty();
IRMA.issue(Cookies.get("jwt"),function() {
showSuccess("iDIN data successfully issued");
}, showWarning, showError);
});
var token = Cookies.get("jwt");
console.log(token);
var decoded = jwt_decode(token);
console.log(decoded.iprequest.request.credentials[0].attributes.address);
});
\ 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