リンク はじめに 管理者 アプリケーション開発者 Catalina開発者 Jasper開発者 | Realm Configuration HOW-TO| Quick Start クイックスタート |
This document describes how to configure Tomcat to support container
managed security, by connecting to an existing "database" of usernames,
passwords, and user roles. You only need to care about this if you are using
a web application that includes one or more
<security-constraint> elements, and a
<login-config> element defining how users are required
to authenticate themselves. If you are not utilizing these features, you can
safely skip this document.
この文書は、ユーザー名、パスワードとユーザー役割の現存の「データベース」に
接続することで、Tomcatがサポートするコンテナセキュリティ管理
の設定方法について説明しています。
あなたが一つ以上の<security-constraint> 要素と
<login-config> 要素を含むWebアプリケーションを使ってユーザー認証する方法を定義している場合だけ、あなたはこれを気にかける必要があるります。
あなたがこれらの機能を利用していないならば、あなたは問題なくこの文書を読み飛ばすことができます。
For fundamental background information about container managed security,
see the Servlet
Specification (Version 2.3), Section 12. For a more introductory level
document for web application developers as well as administrators, see
(FIXME - link to backgrounder on container managed security
to be provided).
コンテナ管理されたセキュリティに関する基本的背景情報のために、Servlet仕様(バージョン2.3)(第12節)を読んでください。
管理者と同様にWebアプリケーション開発者のためのより前置きのレベル文書のために、見てください(FIXME(提供されるコンテナ管理されたセキュリティの背景へのリンク))。
For information about utilizing the Single Sign On feature of
Tomcat 4 (allowing a user to authenticate themselves once across the entire
set of web applications associated with a virtual host), see
here.
バーチャルホストと関連されるWebアプリケーションの全てのセットを横断して、
一度、彼ら自身を認証するためにユーザーを許すことのための
Tomcat 4 のシングルサインオン機能を使うための情報については、
ここを参照してください。
|
| Overview 概要 |
| What is a Realm? レルムとは? |
A Realm is a "database" of usernames and passwords that
identify valid users of a web application (or set of web applications), plus
an enumeration of the list of roles associated with each valid user.
You can think of roles as similar to groups in Unix-like operating
systems, because access to specific web application resources is granted to
all users possessing a particular role (rather than enumerating the list of
associated usernames). A particular user can have any number of roles
associated with their username.
レルムとは、ユーザー名とパスワードの「データベース」で
Webアプリケーション(またはWebアプリケーションのセット)へのユーザの
認証をするためのものであり、さらにそれぞれのユーザに関連する
rolesのリストの列挙があります。
特定のWebアプリケーション・リソースへのアクセスが特定の役割
(関連されたユーザー名のリストを列挙するよりはむしろ)
を所有している全てのユーザーに与えられるので、役割とは
Unixのようなオペレーティングシステムのgroupsに類似したものであると
考えることができます。
特定のユーザーは、どんなたくさんの役割でも彼らのユーザー名と関連しておくことができます。
Although the Servlet Specification describes a portable mechanism for
applications to declare their security requirements (in the
web.xml deployment descriptor), there is no portable API
defining the interface between a servlet container and the associated user
and role information. In many cases, however, it is desireable to "connect"
a servlet container to some existing authentication database or mechanism
that already exists in the production environment. Therefore, Tomcat 4
defines a Java interface (org.apache.catalina.Realm) that
can be implemented by "plug in" components to establish this connection.
Three standard plug-ins are provided, supporting connection to three different
sources of authentication information:
Servlet仕様書がdeclareへの応用のための移植可能な仕組みを記載する、彼らのそこでセキュリティ必要条件(web.xml配備記述で)servletコンテナと関連されたユーザーと役割情報の間のインタフェースを定義している移植可能なAPI以外にす。
しかし多くの場合には、現存の若干の認証データベースへのservletコンテナまたはすでに製品環境の中に存在する仕組みを「接続する」ことは、desireableです。
したがって、Tomcat 4が実装されることができるJavaインタフェース
(org.apache.catalina.Realm)を定義するは、
この接続を確立するためにコンポーネントを「プラグインします」。
3つの標準のプラグインは、認証情報の3つの異なる筋との提供された、
サポートしているつながりです
- JDBCRealm - Accesses authentication information
stored in a relational database, accessed via a JDBC driver.
- JDBCRealm - JDBCドライバー経由でアクセスされる
リレーショナルデータベースに格納されている認証情報にアクセスする
- JNDIRealm - Accesses authentication information
stored in an LDAP based directory server, accessed via a JNDI provider.
- JNDIRealm - JDNIプロバイダー経由でアクセスされる
LDAPベースのディレクトリサーバに格納されている認証情報にアクセスする
- MemoryRealm - Accesses authentication
information stored in an in-memory object collection, which is initialized
from an XML document (
conf/tomcat-users.xml).
- MemoryRealm - XMLドキュメント
(
conf/tomcat-users.xml)から初期化されるメモリに格納される
メモリ内のオブジェクトの集合に格納されている認証情報にアクセスする。
It is also possible to write your own Realm implementation,
and integrate it with Tomcat 4. However, doing this is beyond the scope of
this document. See (FIXME - reference to developer stuff)
for more information.
あなた自身のRealm実装を書いて、それをTomcat 4と統合することは、
また可能です。
しかし、これをすることは、向こうにこの文書の範囲です。
詳細は(FIXME(開発者やり方の参照))を見てください。
|
|
| Standard Realm Implementations 標準レルム実装 |
| JDBCRealm |
Introduction はじめに
JDBCRealm is an implementation of the Tomcat 4
Realm interface that looks up users in a relational database
accessed via a JDBC driver. There is substantial configuration flexibility
that lets you adapt to existing table and column names, as long as your
database structure conforms to the following requirements:
JDBCRealmは、JDBCドライバを経由してリレーショナルデータベース内の
ユーザを検索するTomcat のレルムインタフェースの実装です。
あなたのデータベース構造が以下の必要条件に従う限り、
現存のテーブルとカラム名に適応させる事実上の構成柔軟性があります。
- There must be a table, referenced below as the users table,
that contains one row for every valid user that this
Realm
should recognize.
- テーブルがなければなりません。そして、この
Realmが認識するはずであるあらゆる有効なユーザーごとに1行を含むusersテーブルとしての下で参照されます。
- The users table must contain at least two columns (it may
contain more if your existing applications required it):
usersテーブルは、少なくとも2つのカラム(あなたの現存のアプリケーションがそれを必要とするならば、それはより多くを含むかもしれません)を含まなければなりません
- Username to be recognized by Tomcat when the user logs in.
- ユーザーがログインするときにTomcatによって認識される Username(ユーザー名)。
- Password to be recognized by Tomcat when the user logs in.
This value may in cleartext or digested - see below for more
information.
- ユーザーがログインするときにTomcatによって認識されるPassword(パスワード)。
このカラムの値はクリアテキストやダイジェストかもしれません、詳細は下記参照のこと。
- There must be a table, referenced below as the user roles table,
that contains one row for every valid role that is assigned to a
particular user. It is legal for a user to have zero, one, or more than
one valid role.
- テーブルがなければなりません。そして、特定のユーザーに割り当てられるあらゆる有効な役割のために、1本の列を含むuser rolesテーブルとしての下でリファレンスをつけられます。
ユーザーがゼロ、1または有効な複数の役割を持つことは、法的です。
- The user roles table must contain at least two columns (it may
contain more if your existing applications required it):
user rolesテーブルは、少なくとも2つのカラム(あなたの現存のアプリケーションがそれを必要とするならば、それはより多くを含むかもしれません)を含まなければなりません
- Username to be recognized by Tomcat (same value as is specified
in the users table).
- Tomcat(usersテーブルにおいて、現状のままで指定される同じ値)によって認識されるユーザー名。
- Role name of a valid role associated with this user.
- 有効な役割の名前がこのユーザーと関連した役割。
Quick Start クイックスタート
To set up Tomcat to use JDBCRealm, you will need to follow these steps:
JDBCRealmを使うためにTomcatをセットアップするために、あなたはこれらのステップに追従する必要があります
- If you have not yet done so, create tables and columns in your database
that conform to the requirements described above.
- あなたがまだそうしなかったならば、テーブルをつくってください、そして、上記で述べた必要条件に従うあなたのデータベースの中のカラムを用意してください。
- Configure a database username and password for use by Tomcat, that has
at least read only access to the tables described above. (Tomcat will
never attempt to write to these tables.)
- Tomcatによって使用されるデータベースのユーザ名とパスワードを設定してください、
これは、上記で説明したテーブルに対して少なくともリードオンリーの権限を持たせてください。
(Tomcatは、決してこれらのテーブルに書こうとはしません。)
- Place a copy of the JDBC driver you will be using inside the
$CATALINA_HOME/server/lib directory (if you do not need it
visible to web applications) or $CATALINA_HOME/common/lib
(if it will be used both by Tomcat 4 and by your apps).
Note that only JAR files are recognized!
-
$CATALINA_HOME/server/libディレクトリ(Webアプリケーションに見える必要がない)または$CATALINA_HOME/common/libディレクトリ(それがあなたのアプリとTomcat 4の両方とも使われることになるならば)にJDBCドライバのコピーをおきます。
JARファイルだけが認識されるので注意!
- Set up a
<Realm> element, as described below, in your
$CATALINA_HOME/conf/server.xml file.
- 下記のように、あなたの
$CATALINA_HOME/conf/server.xmlファイルにおいて、<Realm>要素をセットしてください。
- Restart Tomcat 4 if it is already running.
- すでに実行している場合には、Tomcat 4をリスタートしてください。
Realm Element Attributes レルム要素属性
To configure JDBCRealm, you will create a <Realm>
element and nest it in your $CATALINA_HOME/conf/server.xml file,
as described above. The following
attributes are supported by this implementation:
あなたが<Realm> 要素を作成して、ネストしていることになって、JDBCRealmを構成するためにあなたの$CATALINA_HOME/conf/server.xmlファイルの中のそれ、上で記述された
属性に追従することは、この実装でサポートされます。
| Attribute | Description |
|---|
className |
The fully qualified Java class name of this Realm implementation.
You MUST specify the value
"org.apache.catalina.realm.JDBCRealm" here.
このレルム実装のJavaのクラスの完全限定名。
あなたは、値「org.apache.catalina.realm.JDBCRealm」をここで指定し
なければなりません。
| connectionName |
The database username used to establish a JDBC connection.
JDBC接続を確立するために使用されるデータベースユーザ名
| connectionPassword |
The database password used to establish a JDBC connection.
JDBC接続を確立するために使用されるデータベースパスワード
| connectionURL |
The database URL used to establish a JDBC connection.
JDBC接続を確立するために使用されるデータベースURL
| debug |
The level of debugging detail logged by this Realm
to the associated Logger. Higher numbers
generate more detailed output. If not specified, the default
debugging detail level is zero (0).
詳細をデバッグするレベルは、関連されたLoggerにこのレルムによって記録しました。
より高い番号は、より詳細な出力を生成します。
指定されないならば、詳細レベルをデバッグしているデフォルトはゼロ(0)です。
| digest |
The digest algorithm used to store passwords in non-plaintext formats.
Valid values are those accepted for the algorithm name by the
java.security.MessageDigest class. See
Digested Passwords for more
information. If not specified, passwords are stored in clear text.
非ブレインテキスト形式でパスワードを格納する場合に使用されるダイジェスト・アルゴリズム。
有効な値は、java.security.MessageDigestクラスによって、アルゴリズム名のために受け入れられるそれらです。
詳細はDigested Passwordsを見てください。
指定されないならば、パスワードはクリアテキストに格納されます。
| driverName |
The fully qualified Java class name of the JDBC driver to be used.
Consult the documentation for your JDBC driver for the appropriate
value.
使用されるJDBCドライバのJavaのクラスの完全限定名。
適当な値のためにあなたのJDBCドライバのドキュメンテーションを参照してください。
| roleNameCol |
The name of the column, in the user roles table, that
contains the name of a role assigned to this user.
このユーザーに割り当てられる役割の名前を含むuser rolesテーブルでの、カラムの名前。
| userCredCol |
The name of the column, in the users table, that contains
the password for this user (either in clear text, or digested if the
digest attribute is set).
このユーザー(digest属性が設定されていれば、ダイジェストまたは、クリアテキストのどちらでも)のパスワードを含むusersテーブルでの、カラムの名前。
| userNameCol |
The name of the column, in the users and user roles
tables, that contains the username of this user.
このユーザーのユーザー名を含むusersとuser rolesテーブルのカラムの名前。
| userRoleTable |
The name of the table that contains one row for each role
assigned to a particular username. This table must include at
least the columns named by the userNameCol and
roleNameCol attributes.
roleが特定のusernameに割り当てた各々のために、1本の列を含むテーブルの名前
このテーブルは、少なくともuserNameColとroleNameCol属性によって名をつけられるカラムを含まなければなりません。
| userTable |
The name of the table that contains one row for each username
to be recognized by Tomcat. This table must include at least the columns
named by the userNameCol and userCredCol
attributes.
Tomcatによって認識されるために各usernameのために1本の列を含むテーブルの名前。
このテーブルは、少なくともuserNameColとuserCredCol属性によって名をつけられるカラムを含まなければなりません。
|
Example
An example SQL script to create the needed tables might look something
like this (adapt the syntax as required for your particular database):
必要とされるテーブルを作成するSQLスクリプトの例は、これ(必要に応じて構文をあなたの特定のデータベースに適応させてください)のようになるかもしれません
 |  |  |  |
create table users (
user_name varchar(15) not null primary key,
user_pass varchar(15) not null
);
create table user_roles (
user_name varchar(15) not null,
role_name varchar(15) not null,
primary key (user_name, role_name)
);
|  |  |  |  |
Example Realm elements are included (commented out) in the
default $CATALINA_HOME/conf/server.xml file. Here's an example
for using a MySQL database called "authority", configured with the tables
described above, and accessed with username "dbuser" and password "dbpass":
例Realm要素は、デフォルトの$CATALINA_HOME/conf/server.xml
ファイルに含められます(コメントアウトされてます)。
ここで、「authority」と呼ばれていて、上で記述されるテーブルで構成されて、
ユーザー名でアクセスされるMySQLデータベースを使うための例が、
「dbuser」とパスワード「dbpass」です
 |  |  |  |
<Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
driverName="org.gjt.mm.mysql.Driver"
connectionURL="jdbc:mysql://localhost/authority?user=dbuser;password=dbpass"
userTable="users" userNameCol="user_name" userCredCol="user_pass"
userRoleTable="user_roles" roleNameCol="role_name"/>
|  |  |  |  |
Additional Notes
JDBCRealm operates according to the following rules:
JDBCRealm 操作は、以下のルールに従います
- When a user attempts to access a protected resource for the first time,
Tomcat 4 will call the
authenticate() method of this
Realm. Thus, any changes you have made to the database
directly (new users, changed passwords or roles, etc.) will be immediately
reflected.
- ユーザーが初めてアクセスに保護されているリソースを試みるとき、
Tomcat 4はこの
Realmのauthenticate()メソッドを呼ぶことになります。
このように、あなたが直接データベース(新しいユーザー、変わるパスワードまたは役割、その他)に、作ったどんな変更点でも、直ちに表されることになります。
- Once a user has been authenticated, the user (and his or her associated
roles) are cached within Tomcat for the duration of the user's login.
(For FORM-based authentication, that means until the session times out or
is invalidated; for BASIC authentication, that means until the user
closes their browser). Any changes to the database information for an
already authenticated user will not be reflected until
the next time that user logs on again.
- 一旦ユーザーが認証されるならば、ユーザー(そして、彼か彼女の関連された役割)がユーザーのログインの継続期間の間、Tomcatの範囲内でキャッシュされて。
(形式に基づく認証のために、それはセッションまで外へ時間を意味するか、invalidatedされます;
基本の認証のために、ユーザーまでのその手段が彼らのブラウザを閉じること)。
ユーザーが再び記録する次の時間まで、すでに認証されたユーザーのためのデータベース情報への少しの変更点も、表されることにはならなりません。
- Administering the information in the users and user roles
table is the responsibility of your own applications. Tomcat does not
provide any built-in capabilities to maintain users and roles.
- usersとuser rolesテーブルにおいて情報を管理することは、あなた自身のアプリケーションの責任です。
Tomcatは、ユーザーと役割を保守する少しの組み込まれた能力も提供しません。
- Debugging and exception messages logged by this
Realm will
be recorded by the Logger that is associated with our
surrounding Context, Host, or
Engine. By default, the corresponding Logger will create a
log file in the $CATALINA_HOME/logs directory.
- 我々が
Context、HostまたはEngineを囲むことと関連されるLoggerによってこのRealmによって記録されるデバッグしていると例外メッセージは、記録されることになります。
デフォルトで、対応するLoggerは、$CATALINA_HOME/logsディレクトリにおいて、ログ・ファイルを作成することになります。
|
| JNDIRealm |
Introduction はじめに
JNDIRealm is an implementation of the Tomcat 4
Realm interface that looks up users in a directory server
accessed by a JNDI provider (typically, the standard LDAP provider that
is available with the JNDI API classes). There is substantial configuration
flexibility that lets you adapt to the existing schema inside your directory
server, as long as it conforms to the following requirements:
JNDIRealmは、ユーザーをディレクトリ・サーバーで調べるRealmインタフェースがJNDIプロバイダー(一般的に、JNDI APIクラスとともに利用できる標準のLDAPプロバイダー)によって、アクセスしたTomcat 4の実装です。
あなたにそれが必要条件に追従することに従う限り、あなたのディレクトリ・サーバーの中に現存のスキーマに適応させる事実上の構成柔軟性があります
- Each user that can be authenticated is represented by an individual
element in the top level
DirContext that is accessed
via the connectionURL attribute.
connectionURL属性を通してアクセスされる最高のレベルDirContextで認証されることができる各々のユーザーは、個々の要素によって代理をされます。
- The user element must have the following characteristics:
user要素は、以下の特長を持たなければなりません
- The distinguished name (
dn) attribute of this element
contains the username that is presented for authentication.
- この要素の優れた名前入りの(
dn)属性は、認証のために提示されるユーザー名を含みます。
- There must be an attribute (identified by the
userPassword
attribute of our Realm element) that contains the user's
password, either in clear text or digested (see below for more info).
- ユーザーのパスワードを含む属性(我々の
Realm要素のuserPassword属性によって同じになりました)がなければなりません、クリアテキストの中のどちら、あるいは、ダイジェストされます(詳細は下記を見ます)。
- Each group of users that has been assigned a particular role is
represented by an individual element in the top level
DirContext that is accessed via the
connectionURL attribute.
connectionURL属性を通してアクセスされる最高のレベルDirContextで特定の役割を割り当てられたユーザーの各グループは、個々の要素によって代表されます
- The user group element must have the following characteristics:
user group要素は、以下の特長を持たなければなりません
- The set of all possible groups of interest can be selected by an LDAP
search pattern configured by the
roleSearch attribute
of our Realm element.
- 重要な全ての可能なグループの集合は、我々の
Realm要素のroleSearch属性によって構成されるLDAP検索パターンによって選ばれることができる。
- The
roleSearch pattern optionally includes pattern
replacements "{0}" for the distinguished name, and/or "{1} for the
username, of the authenticated user for which roles will be
retrieved.
roleSearchパターンは任意にパターン置き換えを含みます優れた名前のために「{0}」および/または、「役割が取り出されることになる認証されたユーザーの、ユーザー名のために{1}。
- The
roleBase attribute can be set to the element that
is the base of the search for matching roles. If not specified,
the entire directory context will be searched.
roleBase属性は、役割にマッチすることの検索のベースである要素にセットされることができます。
指定されないならば、全てのディレクトリ・コンテキストは捜されることになります。
- The
roleSubtree attribute can be set to true
if you wish to search the entire subtree of the directory context.
The default value of false requests a search of only the
current level.
- あなたがディレクトリ・コンテキストの全てのsubtreeを捜したいならば、
roleSubtree属性はtrueにセットされることができます。
流れだけの検索が水平になるというfalse要求のデフォルトの値。
- The element includes an attribute (whose name is configured by the
roleName attribute of our Realm element)
containing the name of the role represented by this element.
- 要素は、この要素によって表される役割の名前を含んでいる属性(誰の名前が、我々の
Realm要素のroleName属性によって構成されます)を含みます。
- There must be an administrator username and password that Tomcat can
use to establish a connection to the directory server, with at least
read-only access to the information described above. A future
version of Tomcat will support an option to use the user's username and
password to attempt this connection.
- Tomcatが、上で記述される情報への少なくともリードオンリーのアクセスで、ディレクトリ・サーバーへの接続を確立するために使うことができる管理者ユーザー名とパスワードが、なければなりません。
Tomcatの将来のバージョンは、この接続を試みるためにユーザーのユーザー名とパスワードを使用するためにオプションをサポートすることになります。
Quick Start クイックスタート
To set up Tomcat to use JNDIRealm, you will need to follow these steps:
JNDIRealmを使うためにTomcatをセットアップするために、あなたはこれらのステップに追従する必要があります
- Make sure your directory server is configured with a schema that matches
the requirements listed above.
- 上でリストされる必要条件にマッチするスキーマで、あなたのディレクトリ・サーバーが設定されることを確認してください。
- Configure a username and password for use by Tomcat, that has
at least read only access to the information described above. (Tomcat will
never attempt to modify this information.)
- 上で記述される情報へのアクセスに対してTomcatによって、
ユーザー名とパスワードの少なくともリードオンリーを設定してください。
(Tomcatは、決してこの情報を修正することはありません。)
- Place a copy of the JNDI driver you will be using (typically
ldap.jar available with JNDI) inside the
$CATALINA_HOME/server/lib directory (if you do not need it
visible to web applications) or $CATALINA_HOME/common/lib
(if it will be used both by Tomcat 4 and by your apps).
$CATALINA_HOME/サーバー/libディレクトリ内で、使っていることになる(一般的にldap.jarJNDIで利用できる)JNDIドライバのコピー(あなたがそれを必要としない、Webアプリケーションに見える)または$CATALINA_HOME/common/lib(それがあなたのアプリによって両方ともTomcat 4つのandによって使われることになるならば)。
- Set up a
<Realm> element, as described below, in your
$CATALINA_HOME/conf/server.xml file.
- 下記のように、あなたの
$CATALINA_HOME/conf/server.xmlファイルにおいて、<Realm> 要素をセットしてください。
- Restart Tomcat 4 if it is already running.
- すでに実行しているならば、Tomcat 4をリスタートしてください。
Realm Element Attributes レルム要素属性
To configure JNDIRealm, you will create a <Realm>
element and nest it in your $CATALINA_HOME/conf/server.xml file,
as described above. The following
attributes are supported by this implementation:
あなたが<Realm>要素を作成することになって、ネストしている、JNDIRealmを構成するためにあなたの$CATALINA_HOME/conf/server.xmlファイルの中のに記述された上記
属性では以下が、この実装でサポートされます
| Attribute | Description |
|---|
className |
The fully qualified Java class name of this Realm implementation.
You MUST specify the value
"org.apache.catalina.realm.JDBCRealm" here.
このレルム実装のJavaのクラスの完全限定名。
あなたは、値「org.apache.catalina.realm.JDBCRealm」をここで指定し
なければなりません。
| connectionName |
The directory server username used to establish a JNDI connection.
JNDI接続を確立するために使用するディレクトリサーバのユーザ名
| connectionPassword |
The directory server password used to establish a JNDI connection.
JNDI接続を確立するために使用するディレクトリサーバのパスワード
| connectionURL |
The directory server URL used to establish a JNDI connection.
JNDI接続を確立するために使用するディレクトリサーバのURL
| contextFactory |
The fully qualified Java class name of the JNDI context factory to be
used for this connection. By default, the standard JNDI LDAP provider
is used (com.sun.jndi.ldap.LdapCtxFactory).
この接続のために使われるJNDIコンテキストfactoryのJavaクラスの完全限定名。
デフォルトで、標準のJNDI LDAPプロバイダーが、使われます(com.sun.jndi.ldap.LdapCtxFactory)。
| debug |
The level of debugging detail logged by this Realm
to the associated Logger. Higher numbers
generate more detailed output. If not specified, the default
debugging detail level is zero (0).
詳細デバッグレベルは、関連されたLoggerにこのレルムによってロギングされます。
より高い番号は、より詳細な出力を生成します。
指定されなければ、詳細デバッグレベルのデフォルトはゼロ(0)です。
| digest |
The digest algorithm used to store passwords in non-plaintext formats.
Valid values are those accepted for the algorithm name by the
java.security.MessageDigest class. See
Digested Passwords for more
information. If not specified, passwords are stored in clear text.
非プレインテキスト形式でパスワードを格納するのに使用されるダイジェスト・アルゴリズム。
有効な値は、java.security.MessageDigestクラスによって、アルゴリズム名のために受け入れられるそれらです。
詳細はDigested Passwordsを見てください。
指定されなければ、パスワードはクリアテキストで格納されます。
| roleBase |
The base element for role searches. If not specified, the top level
element in the directory context will be used.
役割のためのベース要素は、捜します。
指定されないならば、ディレクトリ・コンテキストでのトップのレベル要素が使われることになります。
| roleName |
The name of the directory server attribute containing the role name.
役割名を含んでいるディレクトリ・サーバー属性の名前。
| roleSearch |
An LDAP search pattern for selecting roles in this Realm, following the
syntax supported by the java.text.MessageFormat class. Use
{0} to substitute in the distinguished name of the user you
want roles for, and/or {1} to substitute in the username of
the user you want roles for.
java.text.MessageFormatクラスでサポートされる構文に追従して、このレルムで役割を選ぶことのLDAP検索原型。
あなたが役割が欲しいユーザーの優れた名前やあなたが役割が欲しいユーザーのユーザー名で、代える{1}で代理をするために、{0}を使ってください。
| roleSubtree |
Set to true if you want role searches to search subtrees
of the element selected by roleBase. The default value of
false causes only the top level element to be searched.
あなたが役割検索にroleBaseによって選ばれる要素のsubtreesを捜して欲しいならば、trueに取りかかってください。
falseのデフォルトの値によって、トップのレベル要素だけが捜されるようになります。
| userPassword |
The name of the directory server attribute (in the user element) that
contains the cleartext or digested user password (depending on the setting
of the digest attribute).
クリアテキストを含むか、ユーザー・パスワード(digest属性をセットすることに依存すること)をダイジェストしたディレクトリ・サーバー属性(ユーザー要素の中の)の名前。
| userPattern |
An LDAP search pattern for selecting users in this Realm, following the
syntax supported by the java.text.MessageFormat class. Use
{0} to substitute in the distinguished name of the user you
want to select.
java.text.MessageFormatクラスで支えられる構文に追従して、このレルムでユーザーを選ぶことのLDAP検索原型。
あなたが選びたいユーザーの優れた名前で代理をするために、{0}を使ってください。
|
Example
Creation of the appropriate schema in your directory server is beyond the
scope of this document, because it is unique to each directory server
implementation. In the examples below, we will assume that you are using a
distribution of the OpenLDAP directory server (version 2.0.11 or later), which
can be downloaded from
http://www.openldap.org. Assume that
your slapd.conf file contains the following settings
(among others):
それが各ディレクトリ・サーバー実装にユニークであるので、あなたのディレクトリ・サーバーの中の適切なスキーマの作成は、向こうにこの文書の範囲です。
下記の例で、我々はあなたがOpenLDAPディレクトリ・サーバー(バージョン2.0.11以降)の配布を使っていると仮定することになります。そして、それはhttp://www.openldap.orgからダウンロードされることができます.
あなたのslapd.confファイルが設定(その中に)に追従することを含むと仮定してください
 |  |  |  |
database ldbm
suffix dc="mycompany",dc="com"
rootdn "cn=Manager,dc=mycompany,dc=com"
rootpw secret
|  |  |  |  |
These settings help us identify values for the values to be specified for
connectionName, and connectionPassword, and we
will assume for connectionURL that the directory server runs on
the same machine as Tomcat. See
http://java.sun.com/products/jndi/docs.html
for more information about configuring and using the JNDI LDAP provider.
これらの設定は我々がconnectionNameのために指定される値のために、値を確認するのを助けます、そして、ディレクトリ・サーバーがTomcatと同じマシンの上で実行するconnectionURLのためにconnectionPasswordと我々は仮定します。
JNDI LDAPプロバイダーを使用やその設定についての詳細は、
http://java.sun.com/products/jndi/docs.htmlを参照してください。
Next, assume that this directory server has been populated with elements
as shown below (in LDIF format), which define the same users and roles
as the default $CATALINA_HOME/conf/tomcat-users.xml does for
MemoryRealm:
次に、デフォルトの$CATALINA_HOME/conf/tomcat-users.xmlがMemoryRealmの役に立つので、同じユーザーと役割を定義するこのディレクトリ・サーバーが以下に示すように要素(LDIFフォーマットで)で住まれてあったと仮定してください
 |  |  |  |
# Define a user named 'tomcat'
dn: cn=tomcat,dc=mycompany,dc=com
cn: tomcat
userPassword: tomcat
sn: Tomcat User
objectClass: person
# Define a user named 'role1'
dn: cn=role1,dc=mycompany,dc=com
cn: role1
userPassword: tomcat
sn: Role1 User
objectClass: person
# Define a user named 'both'
dn: cn=both,dc=mycompany,dc=com
cn: both
userPassword: tomcat
sn: Both User
objectClass: person
# Define an entry to base role searches on
dn: dc=roles,dc=mycompany,dc=com
cn: roles
objectClass: person
sn: Roles Entry
# Define all members of the 'tomcat' role
dn: cn=tomcat,dc=roles,dc=mycompany,dc=com
cn: tomcat
objectClass: groupOfUniqueNames
uniqueMember: cn=tomcat,dc=mycompany,dc=com
uniqueMember: cn=both,dc=mycompany,dc=com
# Define all members of the 'role1' role
dn: cn=role1,dc=roles,dc=mycompany,dc=com
cn: role1
objectClass: groupOfUniqueNames
uniqueMember: cn=role1,dc=mycompany,dc=com
uniqueMember: cn=both,dc=mycompany,dc=com
|  |  |  |  |
An example Realm element for the OpenLDAP directory server
configured as described above might look like this:
 |  |  |  |
<Realm className="org.apache.catalina.realm.JNDIRealm" debug="99"
connectionName="cn=Manager,dc=mycompany,dc=com"
connectionPassword="secret"
connectionURL="ldap://localhost:389"
roleBase="dc=roles,dc=mcclan,dc=net"
roleName="cn"
roleSearch="(uniqueMember={0})"
roleSubtree="false"
userPassword="userPassword"
userPattern="cn={0},dc=mycompany,dc=com"
/>
|  |  |  |  |
Additional Notes
JNDIRealm operates according to the following rules:
JNDIRealmは、以下の規則によって働きます
- When a user attempts to access a protected resource for the first time,
Tomcat 4 will call the
authenticate() method of this
Realm. Thus, any changes you have made to the database
directly (new users, changed passwords or roles, etc.) will be immediately
reflected.
- ユーザーが初めてアクセス保護されているリソースを試みるとき、Tomcat 4はこの
Realmのauthenticate()メソッドを呼ぶことになります。
このように、あなたが直接データベース(新しいユーザー、変わるパスワードまたは役割、その他)に、作ったどんな変更点でも、直ちに表されることになります。
- Once a user has been authenticated, the user (and his or her associated
roles) are cached within Tomcat for the duration of the user's login.
(For FORM-based authentication, that means until the session times out or
is invalidated; for BASIC authentication, that means until the user
closes their browser). Any changes to the database information for an
already authenticated user will not be reflected until
the next time that user logs on again.
- 一旦ユーザーが認証されるならば、ユーザー(そして、彼か彼女の関連された役割)がユーザーのログインの継続期間の間、Tomcatの範囲内でキャッシュされて。
(形式に基づく認証のために、それはセッションまで外へ時間を意味するか、invalidatedされます;
基本の認証のために、ユーザーまでのその手段が彼らのブラウザを閉じること)。
何でも、notをすでに認証されたユーザーのための情報がそうすることになるデータベースに変えますユーザーが再び記録する次の時間まで表します。
- Administering the information in the directory server
is the responsibility of your own applications. Tomcat does not
provide any built-in capabilities to maintain users and roles.
- ディレクトリ・サーバーにおいて情報を管理することは、あなた自身のアプリケーションの責任です。
Tomcatは、ユーザーと役割を維持する少しの組み込まれた能力も提供しません。
- Debugging and exception messages logged by this
Realm will
be recorded by the Logger that is associated with our
surrounding Context, Host, or
Engine. By default, the corresponding Logger will create a
log file in the $CATALINA_HOME/logs directory.
- 我々が
Context、HostまたはEngineを囲むことと関連されるLoggerによってこのRealmによって記録されるデバッグしていると例外メッセージは、記録されることになります。
デフォルトで、対応するLoggerは、$CATALINA_HOME/logsディレクトリにおいて、ログ・ファイルを作成することになります。
|
| MemoryRealm |
Introduction
MemoryRealm is a simple demonstration implementation of the
Tomcat 4 Realm interface. It is not designed for production use.
At startup time, MemoryRealm loads information about all users, and their
corresponding roles, from an XML document (by default, this document is loaded from $CATALINA_HOME/conf/tomcat-users.xml). Changes to the data
in this file are not recognized until Tomcat is restarted.
MemoryRealmは、Tomcat 4のRealm
インタフェースの単純なデモンストレーション実装です。
それは、製品使用のために設計されません。
開始時に、全てのユーザーに関するMemoryRealmロード情報と、XML文書(デフォルトで、この文書は、$CATALINA_HOME/conf/tomcat-users.xmlから載せられます)から、彼らの対応する役割で。
Tomcatをリスタートするまで、このファイルの中のデータへの変更点は認識されません。
Realm Element Attributes レルム要素属性
To configure MemoryRealm, you will create a <Realm>
element and nest it in your $CATALINA_HOME/conf/server.xml file,
as described above. The following
attributes are supported by this implementation:
あなたが<Realm> 要素を作成することになって、ネストしていることになって、MemoryRealmを構成するためにあなたの$CATALINA_HOME/conf/server.xmlファイルの中のそれ、記述された上記
属性に追従することは、この実装で支えられます
| Attribute | Description |
|---|
className |
The fully qualified Java class name of this Realm implementation.
You MUST specify the value
"org.apache.catalina.realm.MemoryRealm" here.
このレルム実装の充分に修飾されたJavaクラス名。
あなたMUSTが、値「org.apache.catalina.realm.MemoryRealm」をここで指定します
| debug |
The level of debugging detail logged by this Realm
to the associated Logger. Higher numbers
generate more detailed output. If not specified, the default
debugging detail level is zero (0).
詳細デバッグレベルは、関連されたLoggerにこのレルムによってロギングします。
より高い番号は、より詳細な出力を生成します。
指定されないならば、詳細デバッグレベルのデフォルトはゼロ(0)です。
| digest |
The digest algorithm used to store passwords in non-plaintext formats.
Valid values are those accepted for the algorithm name by the
java.security.MessageDigest class. See
Digested Passwords for more
information. If not specified, passwords are stored in clear text.
non-plaintextフォーマットでストア・パスワードに使用されるダイジェスト・アルゴリズム。
有効な値は、java.security.MessageDigestクラスによって、アルゴリズム名のために受け入れられるそれらです。
詳細はDigested Passwordsを見てください。
指定されないならば、パスワードはクリアテキストに格納されます。
| pathname |
Absolute or relative (to $CATALINA_HOME) pathname of the XML document
containing our valid usernames, passwords, and roles. See below for more
information on the format of this file. If not specified, the value
conf/tomcat-users.xml is used.
我々の有効なユーザー名、パスワードと役割を含んでいるXML文書の絶対であるか関連している($CATALINA_HOMEに)パス名。
このファイルのフォーマットに関するより多くの情報のための下記参照。
指定されないならば、値conf/tomcat-users.xmlが使われます。
|
User File Format
The users file (by default, conf/tomcat-users.xml must be an
XML document, with a root element <tomcat-users>. Nested
inside the root element will be a <user> element for each
valid user, consisting of the following attributes:
ユーザー・ファイル(デフォルトで、conf/tomcat-users.xmlは、root要素<tomcat-users> で、XML文書でなければなりません。
root要素がそうすることになるネストされていた内部が、<user> 要素です、属性に追従することからなる、各々の有効なユーザーのための
- name - Username this user must log on with.
- name - このユーザのログオン時のユーザ名
- password - Password this user must log on with (in
clear text if the
digest attribute was not set on the
<Realm> element, or digested appropriately as
described here otherwise).
- このユーザーが記録しなければならない(
digestならばクリアテキストにおいて、属性は<Realm> 要素の上に置かれないか、その他の点では記述されたhereとして適切にダイジェストされませんでした)パスワード。
- roles - Comma-delimited list of the role names
associated with this user.
- 名前がこのユーザーと関連した役割のコンマで区切られたリスト。
Example
The default installation of Tomcat 4 is configured with a MemoryRealm
nested inside the <Engine> element, so that it applies
to all virtual hosts and web applications. The default contents of the
conf/tomcat-users.xml file is:
Tomcat 4のデフォルトのインストールは、それが全てのバーチャルホストと
Webアプリケーションに適用されるように<Engine>要素の
内側にネストされたMemoryRealmtが設定されています。
conf/tomcat-users.xmlファイルのデフォルトの内容は以下のようになっています。
 |  |  |  |
<tomcat-users>
<user name="tomcat" password="tomcat" roles="tomcat" />
<user name="role1" password="tomcat" roles="role1" />
<user name="both" password="tomcat" roles="tomcat,role1" />
</tomcat-users>
|  |  |  |  |
Additional Notes 補足事項
MemoryRealm operates according to the following rules:
MemoryRealmは、以下の規則によって働きます
- When Tomcat first starts up, it loads all defined users and their
associated information from the users file. Changes to the data in
this file will not be recognized until Tomcat is
restarted.
- Tomcatが最初に飛び立つとき、それはユーザー・ファイルから全ての定義されたユーザーと彼らの関連された情報をロードします。
このファイルの中のデータへの変更点はそうすることになります。そして、notはTomcatが再開されるまで、認識されてす。
- When a user attempts to access a protected resource for the first time,
Tomcat 4 will call the
authenticate() method of this
Realm.
- ユーザーが初めてアクセスに保護されているリソースを試みるとき、Tomcat 4はこの
Realmのauthenticate()メソッドを呼ぶことになります。
- Once a user has been authenticated, the user (and his or her associated
roles) are cached within Tomcat for the duration of the user's login.
(For FORM-based authentication, that means until the session times out or
is invalidated; for BASIC authentication, that means until the user
closes their browser).
- 一旦ユーザーが認証されるならば、ユーザー(そして、彼か彼女の関連された役割)がユーザーのログインの継続期間の間、Tomcatの範囲内でキャッシュされて。
(形式に基づく認証のために、それはセッションまで外へ時間を意味するか、invalidatedされます;
基本の認証のために、ユーザーまでのその手段が彼らのブラウザを閉じること)。
- Administering the information in the users file is the responsibility
of your application. Tomcat does not
provide any built-in capabilities to maintain users and roles.
- ユーザー・ファイルにおいて情報を管理することは、あなたのアプリケーションの責任です。
Tomcatは、ユーザーと役割を維持する少しの組み込まれた能力も提供しません。
- Debugging and exception messages logged by this
Realm will
be recorded by the Logger that is associated with our
surrounding Context, Host, or
Engine. By default, the corresponding Logger will create a
log file in the $CATALINA_HOME/logs directory.
- 我々が
Context、HostまたはEngineを囲むことと関連されるLoggerによってこのRealmによって記録されるデバッグしていると例外メッセージは、記録されることになります。
デフォルトで、対応するLoggerは、$CATALINA_HOME/logsディレクトリにおいて、ログ・ファイルを作成することになります。
|
|
| Common Features 共通機能 |
| Digested Passwords ダイジェストパスワード |
For each of the standard Realm implementations, the user's
password (by default) is stored in clear text. In many environments, this is
undesireable because casual observers of the authentication data can collect
enough information to log on successfully, and impersonate other users.
To avoid this problem, the standard implementations support the concept of
digesting user passwords. This causes the stored version of the
passwords to be encoded (in a form that is not easily reversible), but that
the Realm implementation can still utilize for authentication.
標準のRealm実装の各々のために、ユーザーのパスワード(デフォルトで)は、クリアテキストで格納されます。
多くの環境には、認証データの偶然のオブザーバーがうまく記録して、他のユーザーに扮するのに十分な情報を集めることができるので、これはundesireableです。
この問題を避けるために、標準の実装は、digestingユーザー・パスワードの概念をサポートします。
これによってパスワードの保存されたバージョンがコード化される(簡単にリバーシブルでない形式で)ようになります、もしRealm実装がまだそうすることができなければ、認証のために利用してください。
Digested passwords are selected by specifying the digest
attribute on your <Realm> element. The value for this
attribute must be one of the digest algorithms supported by the
java.security.MessageDigest class (SHA, MD2, or MD5). When you
select this option, the contents of the password that is stored in the
Realm must be the cleartext version of the password, as digested
by the specified algorithm.
ダイジェストされたパスワードは、あなたの<Realm>要素でdigest属性を指定することによって選ばれます。
この属性のための値は、java.security.MessageDigestクラス(SHA、MD2またはMD5)でサポートされるダイジェスト・アルゴリズムのうちの1つでなければなりません。
あなたがこのオプションを選ぶ、満足させます、指定されたアルゴリズムによってダイジェストされるので、パスワードのcleartext版は、Realmに保存されるパスワードである。
When the authenticate() method of the Realm is called, the
(cleartext) password specified by the user is itself digested by the same
algorithm, and the result is compared with the value returned by the
Realm. An equal match implies that the cleartext version of the
original password is the same as the one presented by the user, so that this
user should be authorized.
レルムのauthenticate()メソッドが呼ばれるとき、ユーザーによって指定される(cleartext)パスワードは同じアルゴリズムによってダイジェストされるそれ自体です、そして、結果はRealmによって返される値と比較されます。
等しいマッチは、本来のパスワードのcleartext版がこのユーザーが許可されるはずであるように、ユーザーによって提示されるものと同じものであることを意味します。
To calculate the digested value of a cleartext password, two convenience
techniques are supported:
クリアテキストパスワードのダイジェストされた値を計算するために、2つの便利な方法が、サポートされます
- If you are writing an application that needs to calculate digested
passowrds dynamically, call the static
Digest() method of the
org.apache.catalina.realm.RealmBase class, passing the
cleartext password and the digest algorithm name as arguments. This
method will return the digested password.
- あなたがダイジェストされたパスワードを動的に計算する必要がある場合には、
org.apache.catalina.realm.RealmBaseクラスの static Digest()メソッドを呼び、引数としてクリアテキストパスワードとアルゴリズムの名前を渡します。
このメソッドは、ダイジェストされたパスワードを返します。
- If you want to execute a command line utility to calculate the digested
password, simply execute
あなたがダイジェストされたパスワードを計算するためにコマンド・ライン・ユーティリティを実行したいならば、単に以下のように実行してください
 |  |  |  |
java org.apache.catalina.realm.RealmBase \
-a {algorithm} {cleartext-password}
|  |  |  |  |
and the digested version of this cleartext password will be returned to
standard output.
そして、このクリアテキストパスワードのダイジェストされたものは、標準出力に返されるます。
To use either of the above techniques, the
$CATALINA_HOME/server/lib/catalina.jar file will need to be
on your class path to make the RealmBase class available.
上記のテクニックのどちらでも使うために、$CATALINA_HOME/サーバー/lib/catalina.jarファイルは、利用できるRealmBaseクラスを作るためにあなたのクラスパスの上にある必要があります。
|
| Manager Application |
If you wish to use the Manager Application
to deploy and undeploy applications in a running Tomcat 4 installation, you
MUST add the "manager" role to at least one username in your selected Realm
implementation. This is because the manager web application itself uses a
security constraint that requires role "manager" to access ANY request URI
within that application.
あなたが実行しているTomcat 4のインストールにおいて展開とundeployアプリケーションにManager Applicationを使いたいならば、あなたはあなたの選択したレルム実装で「manager」役割を少なくとも1つのユーザー名に加えなければなりません。
これは、Manager Webアプリケーションが役割「manager」にそのアプリケーションの範囲内でどんな要求URIにでもアクセスすることを要求するセキュリティ制約を使うからです。
For security reasons, no username in the default Realm (i.e. using
conf/tomcat-users.xml is assigned the "manager" role. Therfore,
no one will be able to utilize the features of this application until the
Tomcat administrator specifically assigns this role to one or more users.
セキュリティ理由のためにデフォルトのレルムでユーザー名(すなわち、conf/tomcat-users.xmlを使うことは、「マネージャー」役割を割り当てられます。
そのため、Tomcat管理者が特にこの役割を一つ以上のユーザーに割り当てるまで、
誰もこのアプリケーションの機能を利用することはできません。
|
|
|