[3] [[HTTP]] [[auth-scheme]] [DFN[[CODE(ABNF)@en[[[Negotiate]]]]]] は、
[[Microsoft Windows]] における [[Kerberos]] 認証を [[HTTP]]
上で実現するためのものとして、 [DFN[[[RFC 4559]]]] で定義されています。

* 仕様書

[REFS[
- [1] '''[CITE@en[RFC 4559 - SPNEGO-based Kerberos and NTLM HTTP Authentication in Microsoft Windows]] ([TIME[2014-03-09 13:55:50 +09:00]] 版) <https://tools.ietf.org/html/rfc4559>'''
- [9] [CITE[RFC Errata Report]] ([TIME[2014-10-21 15:03:16 +09:00]] 版) <http://www.rfc-editor.org/errata_search.php?rfc=4559>
]REFS]

* challenge

[5] [CODE(HTTP)@en[[[WWW-Authenticate:]]]] [[ヘッダー]]に記述する [[challenge]]
では、 [CODE(ABNF)@en[[[auth-scheme]]]] である [CODE(HTTP)@en[[[Negotiate]]]]
に続けて、1つ以上の [[gssapi-data]] または[[空文字列]]を[[リスト]] 
([CODE[#]]) として記述することになっています [SRC[>>1]]。

;; [202] 1つ以上という定義にはなっていますが、[[空文字列]]となり得るので、
省略可能とも解釈できます。

[6] [CODE(HTTP)[[[200]]]] [[応答]]でも [CODE(HTTP)@en[[[WWW-Authenticate:]]]]
[[ヘッダー]]を含めることができます [SRC[>>1]]。

* credentials

[201] [CODE(HTTP)@en[[[Authorization:]]]] [[ヘッダー]]の記述する [[credentials]]
では、 [CODE(ABNF)@en[[[auth-scheme]]]] である [CODE(HTTP)@en[[[Negotiate]]]]
に続けて、1つ以上の [[gssapi-data]]
を[[リスト]] ([CODE[#]]) として記述することになっています [SRC[>>1]]。

* 串

[203] [[串]]の認証には使いません [SRC[>>1]]。

[204] [[クライアント]]と[[鯖]]の間に[[串]]があるときは、
認証された[[接続]]を共有しないように注意が必要です。
[[クライアント]]・[[鯖]]間の[[整合性]]を尊重する[[串]]は
[CODE(HTTP)@en[[[Proxy-support:]] [[Session-Based-Authentication]]]]
[[ヘッダー]]を[[応答]]に含めることになっており、
[[クライアント]]はそうでない場合に本認証を用いては[['''なりません''']]。 [SRC[>>1]]

* HTTP との整合性

[206] [[RFC 7230]] は、[[鯖]]が一般に同じ[[接続]]に含まれる複数の[[要求]]が同じ[[利用者エージェント]]に由来するものと仮定することを禁止しており、
[[RFC 4559]] はこれに違反し[[セキュリティー]]と[[相互運用性]]上の問題があると指摘しています
[SRC[>>205, >>7]]。

;; [CODE(ABNF)@en[[[auth-scheme]]]] も参照。

[REFS[
- [205] [CITE@en[RFC 7230 - Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing]] ([TIME[2014-06-07 01:59:35 +09:00]] 版) <https://tools.ietf.org/html/rfc7230#page-11>
- [7] [CITE@en[RFC 7236 - Initial Hypertext Transfer Protocol (HTTP) Authentication Scheme Registrations]] ([TIME[2014-09-10 00:40:16 +09:00]] 版) <https://tools.ietf.org/html/rfc7236#section-3>
]REFS]

[8] また [[challenge]] と [[credentials]] の構文が [[HTTP]] 本体仕様に適合していません
[SRC[>>7]]。

* [CODE(HTTP)@en[Proxy-Support:]] ヘッダー (HTTP)

[FIG(quote)[
[REFS[
- [1] [CITE@en[Internet Explorer and Custom HTTP Headers - IEInternals - Site Home - MSDN Blogs]] ([TIME[2012-11-18 02:14:23 +09:00]] 版) <http://blogs.msdn.com/b/ieinternals/archive/2009/06/30/internet-explorer-custom-http-headers.aspx>
]REFS]

>
:[CODE[Proxy-Support]]:
Introduced in IE5 (or 6?) to allow proxies to specify that they understand NTLM/Negotiate authentication schemes.  It has one legal value ("Session-Based-Authentication").  If present, IE will permit the multi-step NTLM/Negotiate handshake to take place through a proxy server.  Otherwise, the 401 is treated as a fatal error and returned to the client.
]FIG]

[16] 多段[[串]]になっている時に [CODE(HTTP)@en[[[Connection:]] [[Proxy-support]]]]
が指定されていないと困りそうですが、そのような要件は明記されていません。
実装が指定しているかは不明です。

* 実装

[11] [[IE]]、[[Firefox]] [SRC[>>12]]、 [[Chrome]] [SRC[>>10]] が対応しています。

[15] [[Safari]] では動作しないようです [SRC[>>14]]。

[REFS[
- [10] [CITE[HTTP authentication - The Chromium Projects]] ([TIME[2014-11-07 19:48:57 +09:00]] 版) <http://www.chromium.org/developers/design-documents/http-authentication>
- [12] [CITE[Configuring Firefox for Negotiate Authentication]] ([TIME[2010-07-10 01:02:53 +09:00]] 版) <http://people.redhat.com/mikeb/negotiate/>
- [13] [CITE@en[652196 – No UI for "WWW-Authenticate: Negotiate" / SPNEGO in Firefox; Works in IE]] ([TIME[2014-11-07 22:11:08 +09:00]] 版) <https://bugzilla.mozilla.org/show_bug.cgi?id=652196>
- [14] [CITE[mavericks - Safari 7 can't connect to intranet using HTTP authentication - Ask Different]] ([TIME[2014-11-07 22:12:01 +09:00]] 版) <http://apple.stackexchange.com/questions/118150/safari-7-cant-connect-to-intranet-using-http-authentication>
]REFS]

* 関連

[4] [CODE(HTTP)@en[[[Negotiate:]]]] [[ヘッダー]]とは関係ありません。

* メモ

[2] [CITE@en[HTTP/1.1 WWW-Authenticate header]] ([TIME[2009-07-19 11:05:40 +09:00]] 版) <http://www.http-stats.com/WWW-Authenticate>

>
[PRE(HTTP example code)[
WWW-Authenticate: Negotiate
]PRE]


[17] [CITE[curl - How To Use]], [TIME[2020-09-21T09:01:13.000Z]], [TIME[2020-10-01T06:21:35.313Z]] <https://curl.haxx.se/docs/manpage.html#--negotiate>