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
e3dccc1c
Commit
e3dccc1c
authored
Mar 31, 2017
by
Fabian van den Broek
Browse files
Showing attributes to issue on webpage
parent
5db2d378
Changes
1
Hide whitespace changes
Inline
Side-by-side
iDIN-enroll.js
View file @
e3dccc1c
$
(
function
()
{
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
);
}
}
});
var
translTable
=
{
"
zipcode
"
:
"
Postcode
"
,
"
address
"
:
"
Adres
"
,
"
city
"
:
"
Stad
"
,
"
initials
"
:
"
Initialen
"
,
"
familyName
"
:
"
Achternaam
"
,
"
sex
"
:
"
Geslacht
"
,
"
dateOfBirth
"
:
"
Geboortedatum
"
};
function
addTableLine
(
head
,
data
){
if
(
data
!==
null
)
{
...
...
@@ -39,6 +28,14 @@ $(function() {
+
msg
+
"
</div>
"
);
};
function
displayAttributes
(
attr
,
translator
){
$
.
each
(
attr
,
function
(
key
,
value
){
addTableLine
(
translator
.
hasOwnProperty
(
key
)?
translator
[
key
]:
key
,
value
);
})
}
//set issuing functionality to button
$
(
"
#enroll
"
).
on
(
"
click
"
,
function
()
{
// Clear errors
$
(
"
.form-group
"
).
removeClass
(
"
has-error
"
);
...
...
@@ -48,9 +45,8 @@ $(function() {
},
showWarning
,
showError
);
});
var
token
=
Cookies
.
get
(
"
jwt
"
);
console
.
log
(
token
);
var
decoded
=
jwt_decode
(
token
);
console
.
log
(
decoded
.
iprequest
.
request
.
credentials
[
0
].
attributes
.
address
);
//decode the issuing JWT and show the values in a table
var
decoded
=
jwt_decode
(
Cookies
.
get
(
"
jwt
"
));
displayAttributes
(
decoded
.
iprequest
.
request
.
credentials
[
0
].
attributes
,
translTable
)
});
\ 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