HTTP/1.1で利用できるアクセス認証
基本認証(Basic Authorization)
ダイジェスト認証(Digest Authorization)
基本認証
1.[Client Request]
GET / HTTP/1.0
2.[Server Response]
HTTP/1.0 401 Unauthorized
WWW-Authenticate: Basic realm="Enter your username and password"
3.[Client Request]
("ユーザーID:パスワード"をBase64でエンコードしたものをAuthorizationヘッダーフィールドに指定して送信)
GET / HTTP/1.0
Authorization: Basic gLJIhgGjdlldah
4.[Server Response](認証が成功した場合)
HTTP/1.0 200 OK
[Server Response]
HTTP/1.0 401 Unauthorized
WWW-Authenticate: Basic realm="Enter your username and password"
参考文献:今夜わかるHTTP(上野宣)