-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
58 lines (42 loc) · 1.39 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<!-- JQuery + JQuery UI -->
<script type="text/javascript" src="jquery/js/jquery-1.5.1.min.js"></script>
<script type="text/javascript" src="jquery/js/jquery-ui-1.8.14.custom.min.js"></script>
<link rel="stylesheet" media="screen" type="text/css" href="jquery/css/smoothness/jquery-ui-1.8.14.custom.css" />
<script src="lib/jssha256.js"></script>
<script src="lib/JWT.js"></script>
<title>index</title>
<script>
claims = {
'user_id': 'andreassolberg',
'client_id': 'https://consumer.example.org',
'aud': 'https://example.org'
};
options = {
'iss': 'https://issuer.example.org',
'aud': 'sldkjflsdskjf',
'secret': '87as6d87sa6d87a6s',
'supported_claims' : ['sdf']
};
$(document).ready(function () {
console.log('Creating and signing a JWT');
j = idtoken(options).init(claims);
j.setTimeHeaders(3600); // Set validity of this token to one hour.
o = j.sign();
console.log('Created a signed JWT: ' + o);
console.log('Decoding a JWT');
dj = idtoken(options).init(o);
console.log(dj.getClaims());
console.log(dj.getHeader());
});
</script>
</head>
<body>
<div id="output" style="font-family: monospace;">
</div>
</body>
</html>