第15章 マイグレーション
15.1. アプリケーションセキュリティーの変更設定
基本認証のセキュリティーの設定
UsersRolesLoginModule
は常にクラスパスのプロパティーファイルを検索しました。以前のバージョンの JBoss Enterprise Application Platform では、EAP_HOME/server/SERVER_NAME/conf/
ディレクトリーに置かれたプロパティーファイルはクラスパス上にあり、UsersRolesLoginModule
によって簡単に見つかりました。JBoss Enterprise Application Platform 6 ではディレクトリー構造が変更されました。プロパティーファイルをアプリケーション内でパッケージ化し、クラスパスで使用できるようにする必要があります。
重要
変更がサーバーの再起動後にも維持されるようにするには、サーバー設定ファイルの編集前にサーバーを停止する必要があります。
基本認証のセキュリティーを設定するには、
security-domains
下の新しいセキュリティードメインを standalone/configuration/standalone.xml
または domain/configuration/domain.xml
サーバー設定ファイルに追加します。
<security-domain name="example"> <authentication> <login-module code="UsersRoles" flag="required"> <module-option name="usersProperties" value="${jboss.server.config.dir}/example-users.properties"/> <module-option name="rolesProperties" value="${jboss.server.config.dir}/example-roles.properties"/> </login-module> </authentication> </security-domain>
JBoss Enterpise Application Platform 6 インスタンスがスタンドアロンサーバーとして実行されている場合、
${jboss.server.config.dir}
は EAP_HOME/standalone/configuration/
ディレクトリーを参照します。インスタンスが管理対象ドメインで実行されている場合、${jboss.server.config.dir}
は EAP_HOME/domain/configuration/
ディレクトリーを参照します。
セキュリティードメイン名の変更
JBoss Enterprise Application Platform 6 では、セキュリティードメインは名前で接頭辞 java:/jaas/
を使用しなくなりました。
- Web アプリケーションの場合は、
jboss-web.xml
のセキュリティードメイン設定からこの接頭辞を削除する必要があります。 - Enterprise アプリケーションの場合は、
jboss-ejb3.xml
ファイルのセキュリティードメイン設定からこの接頭辞を削除する必要があります。JBoss Enterprise Application Platform 6 では、jboss.xml
はこのファイルに置き換えられました。