#?SuikaWiki/0.9 page-icon="HTTP" * From specifications ** RFC 1945 (HTTP/1.0); RFC 2068 & 2616 (HTTP/1.1) 10.4.2 401 Unauthorized >The request requires user authentication. The response [DEL[[INS[{1945}]] must]] [INS[[INS[{2068,2616}]] MUST]] include a WWW-Authenticate header field ([DEL[[INS[{1945}]] Section 10.16]] [INS[section [DEL[[INS[{2068}]] 14.46]] [INS[[INS[{2616}]] 14.47]]]]) containing a challenge applicable to the requested resource. The client [DEL[[INS[{1945}]] may]] [INS[[INS[{2068,2616}]] MAY]] repeat the request with a suitable Authorization header field ([DEL[[INS[{1945}]] Section 10.2]] [INS[[INS[{2068,2616}]] section 14.8]]). If the request already included Authorization credentials, then the 401 response indicates that authorization has been refused for those credentials. If the 401 response contains the same challenge as the prior response, and the user agent has already attempted authentication at least once, then the user [DEL[[INS[{1945}]] should]] [INS[[INS[{2068,2616}]] SHOULD]] be presented the entity that was given in the response, since that entity [DEL[[DEL[[INS[{1945}]] may]] [INS[[INS[{2068}]] MAY]]]] [INS[[INS[{2616}]] might]] include relevant diagnostic information. HTTP access authentication is explained in [DEL[[INS[{1945}]] Section 11]] [INS[[INS[{2068}]] section 11]]]] [INS[[INS[{2616}]] "HTTP Authentication: Basic and Digest Access Authentication" [43] ]]. 要求は利用者認証を必要としています。応答は、要求された資源に適用可能な[[誰何]]を含んだ [CODE(HTTP)[[[WWW-Authenticate]]]] 頭欄を含んでいなければ'''なりません'''。クライアントは、適当な [CODE(HTTP)[[[Authorization]]]] 頭欄と共に要求を繰り返しても'''構いません'''。 要求が既に [CODE(HTTP)[Authorization]] 証明書を含んでいる場合、 [CODE(HTTP)[401]] 応答はその証明書について認証が拒否されたことを示します。 [CODE(HTTP)[401]] 応答が前の応答と同じ誰何を含んでおり、利用者エージェントが既に最低一度は認証を試みている時は、 応答に含まれている実体には関係する診断情報が含まれているかもしれませんから、 [INS[[INS[(訳注)]]利用者エージェントは]]これを利用者に提示する'''べきです'''。 ** License [[RFCのライセンス]] * 実装 [402] [[Firefox]] は [CODE(HTTP)@en[[[POST]]]] 時や [[XHR]] で [CODE(HTTP)@en[[[401]]]] が返された時の扱いが一部バグっているようです。 (詳しい再現条件はよくわからないのですが・・・。) 普通なら[[合言葉]]の入力ダイアログ箱が出るところなのですが、出なかったりもして、謎です。 [TIME[2009-09-15T02:10:12.00Z]]