aboutsummaryrefslogtreecommitdiffstats
path: root/site/public/jwt/index.html
diff options
context:
space:
mode:
authorYigit Sever2021-04-19 18:21:06 +0300
committerYigit Sever2021-04-19 18:21:06 +0300
commit81ebd267c89011ca65cd5cfe382e10fabd9017ac (patch)
tree4e1f17b897bc9e3850e9c50861fd4893371f05e4 /site/public/jwt/index.html
parent202625e0e1a4a6a85c895d9cd71a9f419a3b2173 (diff)
downloadgradecoin-81ebd267c89011ca65cd5cfe382e10fabd9017ac.tar.gz
gradecoin-81ebd267c89011ca65cd5cfe382e10fabd9017ac.tar.bz2
gradecoin-81ebd267c89011ca65cd5cfe382e10fabd9017ac.zip
Moving site to separate repo
Diffstat (limited to 'site/public/jwt/index.html')
-rw-r--r--site/public/jwt/index.html182
1 files changed, 0 insertions, 182 deletions
diff --git a/site/public/jwt/index.html b/site/public/jwt/index.html
deleted file mode 100644
index d42d7f3..0000000
--- a/site/public/jwt/index.html
+++ /dev/null
@@ -1,182 +0,0 @@
1<!DOCTYPE html>
2<html lang="en">
3
4<head>
5 <meta charset="UTF-8">
6 <title>JWT | Gradecoin </title>
7 <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
8 <style>
9 :root {
10 /* Primary theme color */
11 --primary-color: #F8D12F;
12 /* Primary theme text color */
13 --primary-text-color: #1E2329;
14 /* Primary theme link color */
15 --primary-link-color: #2F57F7;
16 /* Secondary color: the background body color */
17 --secondary-color: #FAFAFA;
18 --secondary-text-color: #303030;
19 /* Highlight text color of table of content */
20 --toc-highlight-text-color: #d46e13;
21 }
22</style>
23
24 <link href="https://fonts.googleapis.com/css?family=Alfa+Slab+One&display=swap" rel="stylesheet">
25 <link href="https://fonts.googleapis.com/css?family=Fira+Sans:400,500,600&display=swap" rel="stylesheet">
26 <link rel="stylesheet" href="/normalize.css">
27 <link rel="stylesheet" href="https:&#x2F;&#x2F;gradecoin.xyz&#x2F;juice.css">
28
29<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css" />
30<link rel="stylesheet" href="/site.css" />
31
32</head>
33
34<body>
35
36<header class="box-shadow">
37
38
39<a href="https:&#x2F;&#x2F;gradecoin.xyz&#x2F;">
40 <div class="logo">
41 <img src="https:&#x2F;&#x2F;gradecoin.xyz&#x2F;gradecoin.png" alt="logo">
42 Gradecoin
43 </div>
44</a>
45
46<nav>
47
48 <a class="nav-item subtitle-text" href="https:&#x2F;&#x2F;gradecoin.xyz&#x2F;register-docs&#x2F;">Register</a>
49
50 <a class="nav-item subtitle-text" href="https:&#x2F;&#x2F;gradecoin.xyz&#x2F;jwt&#x2F;">JWT</a>
51
52 <a class="nav-item subtitle-text" href="https:&#x2F;&#x2F;gradecoin.xyz&#x2F;transaction-docs&#x2F;">Transactions</a>
53
54 <a class="nav-item subtitle-text" href="https:&#x2F;&#x2F;gradecoin.xyz&#x2F;block-docs&#x2F;">Blocks</a>
55
56 <a class="nav-item subtitle-text" href="https:&#x2F;&#x2F;gradecoin.xyz&#x2F;misc-docs&#x2F;">Misc</a>
57
58
59
60 <a class="nav-item subtitle-text" href="https:&#x2F;&#x2F;github.com&#x2F;zhuowei&#x2F;nft_ptr#why">why?</a>
61
62
63</nav>
64
65</header>
66
67
68 <main>
69
70
71
72
73
74 <div class="toc">
75 <div class="toc-sticky">
76
77 <div class="toc-item">
78 <a class="subtext" href="https://gradecoin.xyz/jwt/#how">How?</a>
79 </div>
80
81
82 <div class="toc-item">
83 <a class="subtext" href="https://gradecoin.xyz/jwt/#algorithm">Algorithm</a>
84 </div>
85
86
87 <div class="toc-item">
88 <a class="subtext" href="https://gradecoin.xyz/jwt/#references">References</a>
89 </div>
90
91
92 </div>
93 </div>
94
95
96
97 <div class="content text">
98
99<div class="heading-text">JSON Web Token Documentation</div>
100<blockquote>
101<p>JSON Web Tokens are representations of claims, or authorization proofs that fit into the <code>Header</code> of HTTP requests.</p>
102</blockquote>
103<h1 id="how">How?</h1>
104<p>JWTs are used as the <a href="https://en.wikipedia.org/wiki/Message_authentication_code">MAC</a> of operations that require authorization:</p>
105<ul>
106<li>block proposal</li>
107<li>transaction proposal.</li>
108</ul>
109<p>They are send alongside the JSON request body in the <code>Header</code>;</p>
110<pre style="background-color:#ffffff;">
111<code class="language-html" data-lang="html"><span style="color:#545052;">Authorization: Bearer aaaaaa.bbbbbb.ccccc
112</span></code></pre>
113<p>Gradecoin uses 3 fields for the JWTs;</p>
114<pre style="background-color:#ffffff;">
115<code class="language-json" data-lang="json"><span style="color:#545052;">{
116&quot;</span><span style="color:#009854;">tha</span><span style="color:#545052;">&quot;: &quot;</span><span style="color:#009854;">Hash of the payload, check invididual references</span><span style="color:#545052;">&quot;,
117&quot;</span><span style="color:#009854;">iat</span><span style="color:#545052;">&quot;: &quot;</span><span style="color:#009854;">Issued At, Unix Time</span><span style="color:#545052;">&quot;,
118&quot;</span><span style="color:#009854;">exp</span><span style="color:#545052;">&quot;: &quot;</span><span style="color:#009854;">Expiration Time, epoch</span><span style="color:#545052;">&quot;
119}
120</span></code></pre>
121<ul>
122<li><code>tha</code> is explained in <a href="https://gradecoin.xyz/block-docs/">blocks</a> and <a href="https://gradecoin.xyz/transaction-docs/">transactions</a> documentations.</li>
123<li><code>iat</code> when the JWT was created in <a href="https://en.wikipedia.org/wiki/Unix_time">Unix Time</a> format</li>
124<li><code>exp</code> when the JWT will expire &amp; be rejected in <a href="https://en.wikipedia.org/wiki/Unix_time">Unix Time</a></li>
125</ul>
126<h1 id="algorithm">Algorithm</h1>
127<p>We are using <a href="https://www.rfc-editor.org/rfc/rfc7518.html#section-3.1">RS256</a>, <code>RSASSA-PKCS1-v1_5 using SHA-256</code>. The JWTs you encode with your private RSA key will be decoded using the public key you have authenticated with. You can see how the process works <a href="https://jwt.io/">here</a>.</p>
128<h1 id="references">References</h1>
129<ul>
130<li><a href="https://tools.ietf.org/html/rfc7519">RFC, the ultimate reference</a></li>
131<li><a href="https://jwt.io/">JWT Debugger</a></li>
132</ul>
133
134
135 </div>
136
137
138
139 </main>
140
141
142<footer>
143Built For ⁂ CENG489 ⁂ Introduction to Computer Security
144</footer>
145
146</body>
147<script>
148 function highlightNav(heading) {
149 let pathname = location.pathname;
150 document.querySelectorAll(".toc a").forEach((item) => {
151 item.classList.remove("active");
152 });
153 document.querySelector(".toc a[href$='" + pathname + "#" + heading + "']").classList.add("active");
154 }
155
156 let currentHeading = "";
157 window.onscroll = function () {
158 let h = document.querySelectorAll("h1,h2,h3,h4,h5,h6");
159 let elementArr = [];
160
161 h.forEach(item => {
162 if (item.id !== "") {
163 elementArr[item.id] = item.getBoundingClientRect().top;
164 }
165 });
166 elementArr.sort();
167 for (let key in elementArr) {
168 if (!elementArr.hasOwnProperty(key)) {
169 continue;
170 }
171 if (elementArr[key] > 0 && elementArr[key] < 300) {
172 if (currentHeading !== key) {
173 highlightNav(key);
174 currentHeading = key;
175 }
176 break;
177 }
178 }
179 }
180</script>
181
182</html>