<s>
In	O
the	O
context	O
of	O
an	O
HTTP	B-Protocol
transaction	O
,	O
basic	B-Protocol
access	I-Protocol
authentication	I-Protocol
is	O
a	O
method	O
for	O
an	O
HTTP	B-Protocol
user	I-Protocol
agent	I-Protocol
(	O
e.g.	O
</s>
<s>
a	O
web	B-Application
browser	I-Application
)	O
to	O
provide	O
a	O
user	O
name	O
and	O
password	O
when	O
making	O
a	O
request	O
.	O
</s>
<s>
In	O
basic	B-Protocol
HTTP	I-Protocol
authentication	I-Protocol
,	O
a	O
request	O
contains	O
a	O
header	O
field	O
in	O
the	O
form	O
of	O
Authorization	O
:	O
Basic	O
<credentials>	O
,	O
where	O
credentials	O
is	O
the	O
Base64	B-Protocol
encoding	I-Protocol
of	O
ID	O
and	O
password	O
joined	O
by	O
a	O
single	O
colon	O
:	O
.	O
</s>
<s>
It	O
was	O
originally	O
implemented	O
by	O
Ari	O
Luotonen	O
at	O
CERN	O
in	O
1993	O
and	O
defined	O
in	O
the	O
HTTP	B-Protocol
1.0	I-Protocol
specification	O
in	O
1996	O
.	O
</s>
<s>
HTTP	B-Protocol
Basic	I-Protocol
authentication	I-Protocol
(	O
BA	O
)	O
implementation	O
is	O
the	O
simplest	O
technique	O
for	O
enforcing	O
access	O
controls	O
to	O
web	O
resources	O
because	O
it	O
does	O
not	O
require	O
cookies	B-Application
,	O
session	O
identifiers	O
,	O
or	O
login	O
pages	O
;	O
rather	O
,	O
HTTP	B-Protocol
Basic	I-Protocol
authentication	I-Protocol
uses	O
standard	O
fields	O
in	O
the	O
HTTP	B-Protocol
header	I-Protocol
.	O
</s>
<s>
They	O
are	O
merely	O
encoded	O
with	O
Base64	B-Protocol
in	O
transit	O
and	O
not	O
encrypted	O
or	O
hashed	B-Algorithm
in	O
any	O
way	O
.	O
</s>
<s>
Therefore	O
,	O
basic	B-Protocol
authentication	I-Protocol
is	O
typically	O
used	O
in	O
conjunction	O
with	O
HTTPS	B-Protocol
to	O
provide	O
confidentiality	O
.	O
</s>
<s>
Because	O
the	O
BA	O
field	O
has	O
to	O
be	O
sent	O
in	O
the	O
header	O
of	O
each	O
HTTP	B-Protocol
request	O
,	O
the	O
web	B-Application
browser	I-Application
needs	O
to	O
cache	B-General_Concept
credentials	O
for	O
a	O
reasonable	O
period	O
of	O
time	O
to	O
avoid	O
constantly	O
prompting	O
the	O
user	O
for	O
their	O
username	O
and	O
password	O
.	O
</s>
<s>
Caching	B-General_Concept
policy	O
differs	O
between	O
browsers	B-Application
.	O
</s>
<s>
HTTP	B-Protocol
does	O
not	O
provide	O
a	O
method	O
for	O
a	O
web	O
server	O
to	O
instruct	O
the	O
client	O
to	O
"	O
log	O
out	O
"	O
the	O
user	O
.	O
</s>
<s>
However	O
,	O
there	O
are	O
a	O
number	O
of	O
methods	O
to	O
clear	O
cached	O
credentials	O
in	O
certain	O
web	B-Application
browsers	I-Application
.	O
</s>
<s>
However	O
,	O
this	O
behavior	O
is	O
inconsistent	O
between	O
various	O
browsers	B-Application
and	O
browser	B-Application
versions	O
.	O
</s>
<s>
Microsoft	B-Application
Internet	I-Application
Explorer	I-Application
offers	O
a	O
dedicated	O
JavaScript	O
method	O
to	O
clear	O
cached	O
credentials	O
:	O
</s>
<s>
In	O
modern	O
browsers	B-Application
,	O
cached	O
credentials	O
for	O
basic	B-Protocol
authentication	I-Protocol
are	O
typically	O
cleared	O
when	O
clearing	O
browsing	O
history	O
.	O
</s>
<s>
Most	O
browsers	B-Application
allow	O
users	O
to	O
specifically	O
clear	O
only	O
credentials	O
,	O
though	O
the	O
option	O
may	O
be	O
hard	O
to	O
find	O
,	O
and	O
typically	O
clears	O
credentials	O
for	O
all	O
visited	O
sites	O
.	O
</s>
<s>
When	O
the	O
server	O
wants	O
the	O
user	B-Protocol
agent	I-Protocol
to	O
authenticate	O
itself	O
towards	O
the	O
server	O
after	O
receiving	O
an	O
unauthenticated	O
request	O
,	O
it	O
must	O
send	O
a	O
response	O
with	O
a	O
HTTP	B-Protocol
401	O
Unauthorized	O
status	O
line	O
and	O
a	O
WWW-Authenticate	O
header	O
field	O
.	O
</s>
<s>
The	O
WWW-Authenticate	O
header	O
field	O
for	O
basic	B-Protocol
authentication	I-Protocol
is	O
constructed	O
as	O
following	O
:	O
</s>
<s>
When	O
the	O
user	B-Protocol
agent	I-Protocol
wants	O
to	O
send	O
authentication	O
credentials	O
to	O
the	O
server	O
,	O
it	O
may	O
use	O
the	O
Authorization	O
header	O
field	O
.	O
</s>
<s>
The	O
resulting	O
string	O
is	O
encoded	O
using	O
a	O
variant	O
of	O
Base64	B-Protocol
(+/	O
and	O
with	O
padding	O
)	O
.	O
</s>
<s>
For	O
example	O
,	O
if	O
the	O
browser	B-Application
uses	O
Aladdin	O
as	O
the	O
username	O
and	O
open	O
sesame	O
as	O
the	O
password	O
,	O
then	O
the	O
field	O
's	O
value	O
is	O
the	O
Base64	B-Protocol
encoding	I-Protocol
of	O
Aladdin:open	O
sesame	O
,	O
or	O
QWxhZGRpbjpvcGVuIHNlc2FtZQ	O
==	O
.	O
</s>
