[7] [[CGI]] の[[メタ変数]] [DFN[[CODE(CGI)@en[[[REMOTE_USER]]]]]] は、[[クライアント]]が[[認証]]のために提供した[[利用者名]]を表します [SRC[>>6]]。 * 仕様書 [REFS[ - [6] [CITE@en[RFC 3875 - The Common Gateway Interface (CGI) Version 1.1]] ([TIME[2011-11-20 06:09:05 +09:00]] 版) ]REFS] * 構文 [8] 値の構文は次の通りです [SRC[>>6]]。 [PRE(ABNF code)[ REMOTE_USER = *[[TEXT]] ]PRE] [9] [[HTTP]] の[[認証]]を行った場合 ([CODE(CGI)@en[[[AUTH_TYPE]]]] が [CODE(HTTP)@en[[[Basic]]]] や [CODE(CGI)@en[[[Digest]]]] の場合) は、 [CODE(CGI)@en[[[REMOTE_USER]]]] はその時の[[利用者]]の ID に設定しなければ[['''なりません''']] [SRC[>>6]]。 * 歴史 [1] CGI/1.1 [NCSA]: > If the server supports user authentication, and the script is protected, this is the username they have authenticated as. サーバーが利用者認証に対応していて、 かつスクリプトが保護されているなら、 これは認証された利用者名です。 [2] CGI/1.1 [COAR 03]: > If the request required authentication using the "Basic" mechanism (i.e., the AUTH_TYPE metavariable is set to "Basic"), then the value of the REMOTE_USER metavariable is set to the user-ID supplied. In all other cases the value of this metavariable is undefined. 要求が「基本」方式を使った認証を必須としているなら (つまり、 [CODE(CGI)[[[AUTH_TYPE]]]] メタ変数が [CODE(CGI)[[[Basic]]]] に設定されているなら)、 [CODE(CGI)[REMOTE_USER]] メタ変数の値は供給された利用者 ID になります。他の全ての場合には、 このメタ変数の値は未定義です。 > - REMOTE_USER = *OCTET >This variable is specific to requests made ''via'' the HTTP protocol. >Servers SHOULD provide this metavariable to scripts. この変数は HTTP プロトコルを''介した''要求に特有のものです。 サーバーはこのメタ変数をスクリプトに提供する'''べきです ([[SHOULD]])。 - [3] [NCSA] の時代には[[基本認証]]しかなかったわけですが、 [COAR] は基本認証以外の場合にこのメタ変数の使用を拒んでますね。 - [4] 関係するメタ変数に [CODE(CGI)[[[REMOTE_IDENT]]]] があります。 [5] SIP-CGI/1.1 [RFC 3050] 5.5.1.10: >If the message requested authentication (i.e., the AUTH_TYPE metavariable is set), then the value of the REMOTE_USER metavariable is set to the user-ID supplied for the authentication. For Basic authentication this is the content of the (decoded) "userid" grammar element; for Digest it is content of "username-value." For PGP authentication, it is the URI specified in the "signed-by" parameter of the Authorization header, if present, otherwise the URI part of the From header. メッセージが認証を要求している場合 (すなわち、 [CODE(CGI)[[[AUTH_TYPE]]]] メタ変数が設定されている場合)、 [CODE(CGI)[REMOTE_USER]] メタ変数の値は認証により供給された利用者 ID に設定されます。 基本認証の場合、これは (復号した) [CODE(SIP)[userid]] 文法要素の内容となります。 Digest の場合は [CODE(SIP)[username-value]] 要素の内容となります。 [[PGP]] 認証では、 [CODE(SIP)[Authorization]] 頭の [CODE(SIP)[[[signed-by]]]] 引数に指定された [[URI]] があればこれ、なければ [CODE(SIP)[From]] 頭の URI 部分です。 >If some other authentication scheme was requested, this metavariable SHOULD be set to an appropriate component of the authorization information identifying the user or entity associated with the credentials. If authentication was not requested, this metavariable is not defined. 他の認証方式が要求された場合、 このメタ変数は証明と関連付けられた利用者又は実体を識別する認証情報の適切な部品が設定される'''べきです'''。 認証が要求されていない場合、 このメタ変数は定義されません。 > - REMOTE_USER = *OCTET >Servers SHOULD provide this metavariable to scripts. サーバーはこのメタ変数をスクリプトに提供する'''べきです'''。 **RFC/I-D の部分の License [[RFCのライセンス]] *メモ