<s>
JSON	B-General_Concept
Web	I-General_Concept
Token	I-General_Concept
(	O
JWT	O
,	O
pronounced	O
,	O
same	O
as	O
the	O
word	O
"	O
jot	O
"	O
)	O
is	O
a	O
proposed	O
Internet	O
standard	O
for	O
creating	O
data	O
with	O
optional	O
signature	O
and/or	O
optional	O
encryption	O
whose	O
payload	O
holds	O
JSON	B-General_Concept
that	O
asserts	O
some	O
number	O
of	O
claims	O
.	O
</s>
<s>
The	O
tokens	B-Protocol
are	O
signed	O
either	O
using	O
a	O
private	O
secret	O
or	O
a	O
public/private	B-Application
key	I-Application
.	O
</s>
<s>
The	O
tokens	B-Protocol
can	O
be	O
signed	O
by	O
one	O
party	O
's	O
private	B-Application
key	I-Application
(	O
usually	O
the	O
server	O
's	O
)	O
so	O
that	O
any	O
party	O
can	O
subsequently	O
verify	O
whether	O
or	O
not	O
the	O
token	O
is	O
legitimate	O
.	O
</s>
<s>
If	O
the	O
other	O
party	O
,	O
by	O
some	O
suitable	O
and	O
trustworthy	O
means	O
,	O
is	O
in	O
possession	O
of	O
the	O
corresponding	O
public	B-Application
key	I-Application
,	O
they	O
too	O
are	O
able	O
to	O
verify	O
the	O
token	O
's	O
legitimacy	O
.	O
</s>
<s>
The	O
tokens	B-Protocol
are	O
designed	O
to	O
be	O
compact	O
,	O
URL-safe	O
,	O
and	O
usable	O
especially	O
in	O
a	O
web-browser	B-Application
single-sign-on	O
(	O
SSO	O
)	O
context	O
.	O
</s>
<s>
JWT	O
claims	O
can	O
typically	O
be	O
used	O
to	O
pass	O
identity	O
of	O
authenticated	O
users	O
between	O
an	O
identity	B-General_Concept
provider	I-General_Concept
and	O
a	O
service	O
provider	O
,	O
or	O
any	O
other	O
type	O
of	O
claims	O
as	O
required	O
by	O
business	O
processes	O
.	O
</s>
<s>
JWT	O
relies	O
on	O
other	O
JSON-based	O
standards	O
:	O
JSON	B-General_Concept
Web	O
Signature	O
and	O
JSON	B-Protocol
Web	I-Protocol
Encryption	I-Protocol
.	O
</s>
<s>
HS256	O
indicates	O
that	O
this	O
token	O
is	O
signed	O
using	O
HMAC-SHA256	B-Algorithm
.	O
</s>
<s>
Typical	O
cryptographic	O
algorithms	O
used	O
are	O
HMAC	B-Algorithm
with	O
SHA-256	B-Algorithm
(	O
HS256	O
)	O
and	O
RSA	O
signature	O
with	O
SHA-256	B-Algorithm
(	O
RS256	O
)	O
.	O
</s>
<s>
JWA	O
(	O
JSON	B-General_Concept
Web	O
Algorithms	O
)	O
RFC	O
7518	O
introduces	O
many	O
more	O
for	O
both	O
authentication	O
and	O
encryption	O
.	O
</s>
<s>
The	O
JWT	O
specification	O
defines	O
seven	O
Registered	O
Claim	O
Names	O
which	O
are	O
the	O
standard	O
fields	O
commonly	O
included	O
in	O
tokens	B-Protocol
.	O
</s>
<s>
This	O
example	O
uses	O
HMAC-SHA256	B-Algorithm
with	O
a	O
shared	O
secret	O
(	O
public	B-Application
key	I-Application
algorithms	I-Application
are	O
also	O
defined	O
)	O
.	O
</s>
<s>
The	O
Base64url	O
Encoding	O
is	O
similar	O
to	O
base64	B-Protocol
,	O
but	O
uses	O
different	O
non-alphanumeric	O
characters	O
and	O
omits	O
padding	O
.	O
</s>
<s>
This	O
resulting	O
token	O
can	O
be	O
easily	O
passed	O
into	O
HTML	B-Language
and	O
HTTP	B-Protocol
.	I-Protocol
</s>
<s>
In	O
authentication	O
,	O
when	O
the	O
user	O
successfully	O
logs	O
in	O
using	O
their	O
credentials	O
,	O
a	O
JSON	B-General_Concept
Web	I-General_Concept
Token	I-General_Concept
will	O
be	O
returned	O
and	O
must	O
be	O
saved	O
locally	O
(	O
typically	O
in	O
local	B-Application
or	I-Application
session	I-Application
storage	I-Application
,	O
but	O
cookies	B-Application
can	O
also	O
be	O
used	O
)	O
,	O
instead	O
of	O
the	O
traditional	O
approach	O
of	O
creating	O
a	O
session	O
in	O
the	O
server	O
and	O
returning	O
a	O
cookie	B-Application
.	O
</s>
<s>
For	O
unattended	O
processes	O
the	O
client	O
may	O
also	O
authenticate	O
directly	O
by	O
generating	O
and	O
signing	O
its	O
own	O
JWT	O
with	O
a	O
pre-shared	O
secret	O
and	O
pass	O
it	O
to	O
a	O
OAuth	O
compliant	O
service	O
like	O
so:If	O
the	O
client	O
passes	O
a	O
valid	O
JWT	O
assertion	O
the	O
server	O
will	O
generate	O
an	O
access_token	O
valid	O
for	O
making	O
calls	O
to	O
the	O
application	O
and	O
pass	O
it	O
back	O
to	O
the	O
client:When	O
the	O
client	O
wants	O
to	O
access	O
a	O
protected	O
route	O
or	O
resource	O
,	O
the	O
user	O
agent	O
should	O
send	O
the	O
JWT	O
,	O
typically	O
in	O
the	O
Authorization	O
HTTP	B-Protocol
header	I-Protocol
using	O
the	O
Bearer	O
schema	O
.	O
</s>
<s>
The	O
server	O
will	O
match	O
this	O
value	O
to	O
a	O
key	O
on	O
file	O
in	O
order	O
to	O
verify	O
that	O
the	O
signature	O
is	O
valid	O
and	O
the	O
token	O
is	O
authentic.x5cx.509	O
Certificate	O
ChainA	O
certificate	O
chain	O
in	O
RFC4945	O
format	O
corresponding	O
to	O
the	O
private	B-Application
key	I-Application
used	O
to	O
generate	O
the	O
token	O
signature	O
.	O
</s>
<s>
The	O
server	O
will	O
use	O
this	O
information	O
to	O
verify	O
that	O
the	O
signature	O
is	O
valid	O
and	O
the	O
token	O
is	O
authentic.x5ux.509	O
Certificate	O
Chain	O
URLA	O
URL	O
where	O
the	O
server	O
can	O
retrieve	O
a	O
certificate	O
chain	O
corresponding	O
to	O
the	O
private	B-Application
key	I-Application
used	O
to	O
generate	O
the	O
token	O
signature	O
.	O
</s>
<s>
.NET	B-Application
(	O
C#	O
VB.Net	O
etc	O
.	O
)	O
</s>
<s>
JSON	B-General_Concept
web	I-General_Concept
tokens	I-General_Concept
may	O
contain	O
session	O
state	O
.	O
</s>
<s>
To	O
validate	O
that	O
the	O
session	O
stored	O
in	O
the	O
token	O
is	O
not	O
revoked	O
,	O
token	O
assertions	O
must	O
be	O
checked	O
against	O
a	O
data	B-General_Concept
store	I-General_Concept
.	O
</s>
<s>
This	O
renders	O
the	O
tokens	B-Protocol
no	O
longer	O
stateless	O
,	O
undermining	O
the	O
primary	O
advantage	O
of	O
JWTs	O
.	O
</s>
<s>
Security	O
consultant	O
Tim	O
McLean	O
reported	O
vulnerabilities	O
in	O
some	O
JWT	O
libraries	O
that	O
used	O
the	O
alg	O
field	O
to	O
incorrectly	O
validate	O
tokens	B-Protocol
,	O
most	O
commonly	O
by	O
accepting	O
a	O
alg	O
=	O
none	O
token	O
.	O
</s>
