Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
IRMA
Github mirrors
irma_idin_webclient
Commits
5db2d378
Commit
5db2d378
authored
Mar 29, 2017
by
Fabian van den Broek
Browse files
working iDIN-test issuance
parent
beee08dc
Changes
2
Hide whitespace changes
Inline
Side-by-side
enroll.html
View file @
5db2d378
...
...
@@ -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>
...
...
iDIN-enroll.js
View file @
5db2d378
$
(
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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment