Skip to content

Commit b6e4495

Browse files
committed
Merge branch 'updated-intro' of github.com:diegopoza/jsonwebtoken.github.io into updated-intro
2 parents 4d66a1b + 96b570d commit b6e4495

File tree

9 files changed

+290
-20
lines changed

9 files changed

+290
-20
lines changed

css/app.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

introduction/index.html

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,21 @@ <h2 id="which-is-the-json-web-token-structure-">Which is the JSON Web Token stru
2020
<ul>
2121
<li>Header</li>
2222
<li>Payload</li>
23-
<li>Signature </li>
23+
<li>Signature</li>
2424
</ul>
2525
<p>Therefore, a JWT typically looks like the following.</p>
2626
<p><code>xxxxx.yyyyy.zzzzz</code></p>
2727
<p>Let&#39;s break down the different parts.</p>
2828
<h3 id="header">Header</h3>
29-
<p>The header <em>typically</em> consists of two parts: the type of the token, which is JWT, and the hashing algorithm such as HMAC SHA256 or RSA.
30-
;aksjdhf ;kajhsdfl gkjafgljsdf;gkjdflskgjs;dkfj gl;skjdfg </p>
29+
<p>The header <em>typically</em> consists of two parts: the type of the token, which is JWT, and the hashing algorithm such as HMAC SHA256 or RSA.</p>
3130
<p>For example:</p>
3231
<pre><code>{
3332
&quot;alg&quot;: &quot;HS256&quot;,
3433
&quot;typ&quot;: &quot;JWT&quot;
3534
}
3635
</code></pre><p>Then, this JSON is <strong>Base64Url</strong> encoded to form the first part of the JWT.</p>
3736
<h3 id="payload">Payload</h3>
38-
<p>The second part of the token is the payload, which contains the claims. Claims are statements about an entity (typically, the user) and additional metadata.
37+
<p>The second part of the token is the payload, which contains the claims. Claims are statements about an entity (typically, the user) and additional metadata.
3938
There are three types of claims: <em>reserved</em>, <em>public</em>, and <em>private</em> claims.</p>
4039
<ul>
4140
<li><p><strong>Reserved claims</strong>: These are a set of predefined claims, which are not mandatory but recommended, thought to provide a set of useful, interoperable claims. Some of them are: <strong>iss</strong> (issuer), <strong>exp</strong> (expiration time), <strong>sub</strong> (subject), <strong>aud</strong> (audience), among others.</p>
@@ -88,7 +87,7 @@ <h2 id="why-should-we-use-json-web-tokens-">Why should we use JSON Web Tokens?</
8887
<em>Comparison of the length of an encoded JWT and an encoded SAML</em></p>
8988
<p>If you want to read more about JSON Web Tokens and even start using them to perform authentication in your own applications, browse to the <a href="http://auth0.com/learn/json-web-tokens">JSON Web Token landing page</a> in Auth0.</p>
9089
</div></section><section class="go-tool"><div class="container"><p>Get started with JWT today</p><a href="/#debugger" class="btn btn-success">Start using the tool</a></div></section><div class="tokens-created"><div class="container"><img src="/img/pic_logo_ft.svg"><p>JWT.io is brought to you by Auth0.</p><p>A cloud service, APIs and tools that eliminate the friction of identity for your applications and APIs.</p><a href="https://auth0.com/signup" target="_blank" class="btn btn-success">Create free account</a><div class="token"><h5>TOKENS CREATED</h5></div><div class="counter"></div></div></div><footer><div class="container"><div class="columns"><div class="column"><a href="https://auth0.com/" target="_blank">Supported by<img src="/img/ico_logo.svg"></a></div><div class="column pull-request"><span>Missing something?</span><a href="https://github.com/jsonwebtoken/jsonwebtoken.github.io/tree/master/views" target="_blank">Send a Pull Request</a></div><div class="column social-counter"><a href="https://twitter.com/auth0" data-show-count="true" class="twitter-follow-button">Follow @auth0</a></div></div></div></footer><!--Bootstrap core JavaScript
91-
==================================================--><!-- Placed at the end of the document so the pages load faster--><script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script><script src="/js/bootstrap.min.js"></script><!-- build:js dist/js/app.js--><script src="/vendor/zepto/zepto.js"></script><script src="/vendor/jsonlint/lib/jsonlint.js"></script><script src="/vendor/json-sans-eval-min/index.js"></script><script src="/vendor/codemirror/lib/codemirror.js"></script><script src="/vendor/codemirror/mode/javascript/javascript.js"></script><script src="/vendor/codemirror/addon/lint/lint.js"></script><script src="/vendor/codemirror/addon/lint/javascript-lint.js"></script><script src="/vendor/codemirror/addon/lint/json-lint.js"></script><script src="/vendor/jsrsasign/index.js"></script><script src="/vendor/jws.js/index.js"></script><script src="/js/jwt_mode.js"></script><script src="/js/jwt.js"></script><script src="/js/isotope.pkgd.min.js"></script><script src="/js/flipclock.js"></script><script src="/js/accordion.js"></script><script src="/js/app.js"></script><!-- endbuild--><script>(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
90+
==================================================--><!-- Placed at the end of the document so the pages load faster--><script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script><script src="/js/bootstrap.min.js"></script><!-- build:js dist/js/app.js--><script src="/vendor/zepto/zepto.js"></script><script src="/vendor/jsonlint/lib/jsonlint.js"></script><script src="/vendor/json-sans-eval-min/index.js"></script><script src="/vendor/codemirror/lib/codemirror.js"></script><script src="/vendor/codemirror/mode/javascript/javascript.js"></script><script src="/vendor/codemirror/addon/lint/lint.js"></script><script src="/vendor/codemirror/addon/lint/javascript-lint.js"></script><script src="/vendor/codemirror/addon/lint/json-lint.js"></script><script src="/vendor/jsrsasign/index.js"></script><script src="/vendor/jws.js/index.js"></script><script src="/js/jwt_mode.js"></script><script src="/js/jwt.js"></script><script src="/js/isotope.pkgd.min.js"></script><script src="/js/flipclock.js"></script><script src="/js/accordion.js"></script><script src="/js/highlight.min.js"></script><script src="/js/app.js"></script><!-- endbuild--><script>(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
9291
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
9392
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
9493
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

js/app.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,23 @@ if (location.href.indexOf("#libraries") != -1) {
3838
scrollTo($('#libraries-io'));
3939
}
4040

41+
/*
42+
* hljs
43+
*/
44+
hljs.configure({
45+
classPrefix: ''
46+
});
47+
48+
$('.plain-text pre code').each(function(i, block) {
49+
var $snippet = $(this);
50+
51+
if(!$snippet.hasClass('hljs')) {
52+
hljs.highlightBlock(block);
53+
hljs.lineNumbersBlock(block);
54+
$snippet.addClass('hljs');
55+
}
56+
});
57+
4158
/*
4259
* Show icon
4360
*/

js/highlight.min.js

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

stylus/app.styl

Lines changed: 116 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
@import 'mixins'
22
@import 'codemirror'
33
@import 'flip-clock'
4+
@import 'highlight'
45

56
/*
67
* Webfont
@@ -934,25 +935,130 @@ body
934935
.container
935936
max-width 630px
936937

937-
h2
938-
margin-top 50px
938+
h1
939939
font-size 25px
940+
font-weight 300
941+
color #333
942+
margin-top 10px
943+
line-height 1.3
944+
+breakpoint("mobile-landscape")
945+
font-size 40px
940946

941-
h3
947+
& > h1, & > hr
948+
display none
949+
950+
h2, h3, h4, h5, h6
951+
&.anchor-heading
952+
position relative
953+
954+
.anchor
955+
display none
956+
+breakpoint("tablet")
957+
position absolute
958+
top 0
959+
left -25px
960+
visibility hidden
961+
&:hover
962+
+breakpoint("tablet")
963+
.anchor
964+
visibility visible
965+
966+
h2, h3, h4
967+
font-weight 700
968+
color #333
969+
line-height 1.3
970+
971+
h2
942972
font-size 20px
973+
margin-top 40px
974+
&:first-child
975+
margin-top 0
943976

944-
p
945-
line-height 1.8
946-
font-size 18px
977+
h3
978+
font-size 16px
947979

980+
h4, h5, h6
981+
font-size 13px
982+
text-transform uppercase
983+
letter-spacing 1px
984+
985+
p, ul li
986+
color #5c666f
987+
font-size 16px
988+
line-height 2
989+
strong
990+
color #333
948991
code
949-
background-color rgba(#D8D8D8,.35)
950-
font-size 75%
951-
border-radius 3px
952-
padding 2px 4px
992+
border-radius 4px
993+
font-size 90%
994+
padding 3px 8px
995+
background-color #F7F7F7
996+
997+
blockquote
998+
background-color lighten(#F7F7F7, 55%)
999+
padding 60px 30px
1000+
border-radius 3px
1001+
margin 30px 0
1002+
text-align center
1003+
border none
1004+
1005+
p
1006+
margin 0
1007+
font-size 12px
1008+
+breakpoint("tablet")
1009+
font-size 16px
1010+
1011+
em
1012+
font-size 18px
1013+
line-height 1.5
1014+
+breakpoint("tablet")
1015+
font-size 25px
1016+
1017+
strong
1018+
display block
1019+
margin-top 15px
1020+
color rgba(#333,.5)
1021+
text-transform uppercase
1022+
1023+
sup
1024+
font-size 90%
9531025

9541026
img
1027+
max-width 100%
1028+
1029+
table
1030+
border-collapse collapse
9551031
width 100%
1032+
margin 20px 0 30px
1033+
1034+
thead tr th
1035+
font-family Helvetica, Arial, sans-serif
1036+
font-weight bold
1037+
text-align center
1038+
font-size 13px
1039+
1040+
td, th
1041+
border 1px solid #E0E0E0
1042+
padding 0.5rem
1043+
text-align left
1044+
1045+
tbody tr:nth-child(odd)
1046+
background rgba(#eee,.5)
1047+
1048+
pre
1049+
display block
1050+
font-size 13px
1051+
line-height 1.42857143
1052+
color #333
1053+
word-break break-all
1054+
background-color #f5f5f5
1055+
border-radius 4px
1056+
margin-bottom 30px
1057+
1058+
pre code
1059+
font-size inherit
1060+
border none
1061+
border-radius 0
9561062

9571063

9581064
// go-tool

stylus/highlight.styl

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
.hljs{display:block;overflow-x:auto;padding:0.5em;background:#f0f0f0;-webkit-text-size-adjust:none}.hljs,.hljs-subst,.hljs-tag .hljs-title,.nginx .hljs-title{color:black}.hljs-string,.hljs-title,.hljs-constant,.hljs-parent,.hljs-tag .hljs-value,.hljs-rule .hljs-value,.hljs-preprocessor,.hljs-pragma,.hljs-name,.haml .hljs-symbol,.ruby .hljs-symbol,.ruby .hljs-symbol .hljs-string,.hljs-template_tag,.django .hljs-variable,.smalltalk .hljs-class,.hljs-addition,.hljs-flow,.hljs-stream,.bash .hljs-variable,.pf .hljs-variable,.apache .hljs-tag,.apache .hljs-cbracket,.tex .hljs-command,.tex .hljs-special,.erlang_repl .hljs-function_or_atom,.asciidoc .hljs-header,.markdown .hljs-header,.coffeescript .hljs-attribute,.tp .hljs-variable{color:#800}.smartquote,.hljs-comment,.hljs-annotation,.diff .hljs-header,.hljs-chunk,.asciidoc .hljs-blockquote,.markdown .hljs-blockquote{color:#888}.hljs-number,.hljs-date,.hljs-regexp,.hljs-literal,.hljs-hexcolor,.smalltalk .hljs-symbol,.smalltalk .hljs-char,.go .hljs-constant,.hljs-change,.lasso .hljs-variable,.makefile .hljs-variable,.asciidoc .hljs-bullet,.markdown .hljs-bullet,.asciidoc .hljs-link_url,.markdown .hljs-link_url{color:#080}.hljs-label,.ruby .hljs-string,.hljs-decorator,.hljs-filter .hljs-argument,.hljs-localvars,.hljs-array,.hljs-attr_selector,.hljs-important,.hljs-pseudo,.hljs-pi,.haml .hljs-bullet,.hljs-doctype,.hljs-deletion,.hljs-envvar,.hljs-shebang,.apache .hljs-sqbracket,.nginx .hljs-built_in,.tex .hljs-formula,.erlang_repl .hljs-reserved,.hljs-prompt,.asciidoc .hljs-link_label,.markdown .hljs-link_label,.vhdl .hljs-attribute,.clojure .hljs-attribute,.asciidoc .hljs-attribute,.lasso .hljs-attribute,.coffeescript .hljs-property,.hljs-phony{color:#88f}.hljs-keyword,.hljs-id,.hljs-title,.hljs-built_in,.css .hljs-tag,.hljs-doctag,.smalltalk .hljs-class,.hljs-winutils,.bash .hljs-variable,.pf .hljs-variable,.apache .hljs-tag,.hljs-type,.hljs-typename,.tex .hljs-command,.asciidoc .hljs-strong,.markdown .hljs-strong,.hljs-request,.hljs-status,.tp .hljs-data,.tp .hljs-io{font-weight:bold}.asciidoc .hljs-emphasis,.markdown .hljs-emphasis,.tp .hljs-units{font-style:italic}.nginx .hljs-built_in{font-weight:normal}
2+
3+
.main-content
4+
pre
5+
padding 0
6+
word-wrap normal
7+
8+
pre
9+
word-wrap normal
10+
position relative
11+
12+
code.hljs
13+
background-color #2F383D
14+
white-space pre
15+
padding 15px
16+
color white
17+
18+
code.hljs-line-numbers.hljs-line-numbers
19+
background-color darken(#2F383D, 10%)
20+
border-right 1px solid rgba(#5C666F,.1)
21+
text-align right
22+
color rgba(255, 255, 255, 0.4)
23+
-webkit-touch-callout none
24+
-webkit-user-select none
25+
-khtml-user-select none
26+
-moz-user-select none
27+
-ms-user-select none
28+
user-select none
29+
30+
.hljs
31+
.subst,
32+
.lisp .title,
33+
.clojure .built_in,
34+
.nginx .title
35+
color color_oil
36+
37+
.string,
38+
.title,
39+
.constant,
40+
.parent,
41+
.tag .value,
42+
.rules .value,
43+
.rules .value .number,
44+
.preprocessor,
45+
.ruby .symbol,
46+
.ruby .symbol .string,
47+
.aggregate,
48+
.template_tag,
49+
.django .variable,
50+
.smalltalk .class,
51+
.addition,
52+
.flow,
53+
.stream,
54+
.bash .variable,
55+
.apache .tag,
56+
.apache .cbracket,
57+
.tex .command,
58+
.tex .special,
59+
.erlang_repl .function_or_atom,
60+
.markdown .header
61+
color #00FBCA // green
62+
63+
.comment,
64+
.annotation,
65+
.template_comment,
66+
.diff .header,
67+
.chunk,
68+
.markdown .blockquote
69+
color #899FAB // oil light
70+
71+
.number,
72+
.title,
73+
.date,
74+
.regexp,
75+
.literal,
76+
.smalltalk .symbol,
77+
.smalltalk .char,
78+
.go .constant,
79+
.change,
80+
.markdown .bullet,
81+
.markdown .link_url
82+
color #42C7F4 // blue light
83+
84+
.label,
85+
.tag,
86+
.javadoc,
87+
.ruby .string,
88+
.decorator,
89+
.filter .argument,
90+
.localvars,
91+
.array,
92+
.attr_selector,
93+
.important,
94+
.pseudo,
95+
.pi,
96+
.doctype,
97+
.deletion,
98+
.envvar,
99+
.shebang,
100+
.apache .sqbracket,
101+
.nginx .built_in,
102+
.tex .formula,
103+
.erlang_repl .reserved,
104+
.prompt,
105+
.markdown .link_label,
106+
.vhdl .attribute,
107+
.clojure .attribute,
108+
.coffeescript .property
109+
color #FFA0E7 // pink
110+
111+
112+
.id,
113+
.phpdoc,
114+
.built_in,
115+
.aggregate,
116+
.css .tag,
117+
.javadoctag,
118+
.phpdoc,
119+
.yardoctag,
120+
.smalltalk .class,
121+
.winutils,
122+
.bash .variable,
123+
.apache .tag,
124+
.go .typename,
125+
.tex .command,
126+
.markdown .strong,
127+
.request,
128+
.status,
129+
.tag .title,
130+
.keyword
131+
color #FF9A56 // orange
132+
133+
.coffeescript .javascript,
134+
.javascript .xml,
135+
.tex .formula,
136+
.xml .javascript,
137+
.xml .vbscript,
138+
.xml .css,
139+
.xml .cdata
140+
opacity: 1;
141+
142+

views/layout.jade

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ html(lang='en')
125125
script(src='/js/isotope.pkgd.min.js')
126126
script(src='/js/flipclock.js')
127127
script(src='/js/accordion.js')
128+
script(src='/js/highlight.min.js')
128129

129130
script(src='/js/app.js')
130131
// endbuild

views/md/introduction.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ JSON Web Tokens consist of three parts separated by dots (`.`), which are:
1919

2020
- Header
2121
- Payload
22-
- Signature
22+
- Signature
2323

2424
Therefore, a JWT typically looks like the following.
2525

@@ -30,7 +30,6 @@ Let's break down the different parts.
3030
### Header
3131

3232
The header *typically* consists of two parts: the type of the token, which is JWT, and the hashing algorithm such as HMAC SHA256 or RSA.
33-
;aksjdhf ;kajhsdfl gkjafgljsdf;gkjdflskgjs;dkfj gl;skjdfg
3433

3534
For example:
3635

@@ -45,7 +44,7 @@ Then, this JSON is **Base64Url** encoded to form the first part of the JWT.
4544

4645
### Payload
4746

48-
The second part of the token is the payload, which contains the claims. Claims are statements about an entity (typically, the user) and additional metadata.
47+
The second part of the token is the payload, which contains the claims. Claims are statements about an entity (typically, the user) and additional metadata.
4948
There are three types of claims: *reserved*, *public*, and *private* claims.
5049

5150
- **Reserved claims**: These are a set of predefined claims, which are not mandatory but recommended, thought to provide a set of useful, interoperable claims. Some of them are: **iss** (issuer), **exp** (expiration time), **sub** (subject), **aud** (audience), among others.

0 commit comments

Comments
 (0)