2.4. LDAP ベースのアイデンティティーストアでの認証設定
ユーザー名、パスワード、およびロールの LDAP 形式を決定します。
アイデンティティーストアに LDAP サーバーを使用して認証を設定するには、ユーザー名、パスワード、およびロールの保存方法を決定する必要があります。この例では、以下の構造を使用しています。
dn: dc=wildfly,dc=org dc: wildfly objectClass: top objectClass: domain dn: ou=Users,dc=wildfly,dc=org objectClass: organizationalUnit objectClass: top ou: Users dn: uid=jsmith,ou=Users,dc=wildfly,dc=org objectClass: top objectClass: person objectClass: inetOrgPerson cn: John Smith sn: smith uid: jsmith userPassword: password123 dn: ou=Roles,dc=wildfly,dc=org objectclass: top objectclass: organizationalUnit ou: Roles dn: cn=Admin,ou=Roles,dc=wildfly,dc=org objectClass: top objectClass: groupOfNames cn: Admin member: uid=jsmith,ou=Users,dc=wildfly,dc=org
dir-context
を設定します。JBoss EAP から LDAP サーバーに接続するには、URL を指定する
dir-context
と、サーバーへの接続に使用するプリンシパルを設定する必要があります。/subsystem=elytron/dir-context=exampleDC:add(url="ldap://127.0.0.1:10389",principal="uid=admin,ou=system",credential-reference={clear-text="secret"})
注記JMX
ObjectName
を使用して LDAP 認証情報を復号化することはできません。代わりに、JBoss EAP の サーバーセキュリティーの設定方法 で説明されているように、クレデンシャルストア を使用して認証情報のセキュリティーを確保できます。JBoss EAP で
ldap-realm
を設定します。/subsystem=elytron/ldap-realm=exampleLR:add(dir-context=exampleDC,identity-mapping={search-base-dn="ou=Users,dc=wildfly,dc=org",rdn-identifier="uid",user-password-mapper={from="userPassword"},attribute-mapping=[{filter-base-dn="ou=Roles,dc=wildfly,dc=org",filter="(&(objectClass=groupOfNames)(member={0}))",from="cn",to="Roles"}]})
警告参照元の LDAP サーバーに参照のループが含まれる場合には、JBoss EAP サーバーで
java.lang.OutOfMemoryError
エラーが発生する可能性があります。simple-role-decoder
を追加します。/subsystem=elytron/simple-role-decoder=from-roles-attribute:add(attribute=Roles)
security-domain
を設定します。/subsystem=elytron/security-domain=exampleLdapSD:add(realms=[{realm=exampleLR,role-decoder=from-roles-attribute}],default-realm=exampleLR,permission-mapper=default-permission-mapper)
undertow
サブシステムでapplication-security-domain
を設定します。/subsystem=undertow/application-security-domain=exampleApplicationDomain:add(security-domain=exampleLdapSD)
注記Configuration → Subsystems → Web (Undertow) → Application Security Domain に移動して、管理コンソールを使用して
undertow
サブシステムのapplication-security-domain
を設定できます。アプリケーションの
web.xml
およびjboss-web.xml
を設定します。アプリケーションの
web.xml
およびjboss-web.xml
は、JBoss EAP で設定したapplication-security-domain
を使用するように更新する必要があります。このサンプルは、Configure Web Applications to use Elytron or Legacy Security for Authentication で確認できます。
elytron
サブシステムで LDAP サーバーを使用して認証を実行しており、この LDAP サーバーに到達できない場合に、JBoss EAP は 500
または内部サーバーエラーを返します。この動作は、同じ状況下でレガシーの security
サブシステムを使用する以前の JBoss EAP バージョンが 401
または不正アクセスのエラーコードを返す動作とは異なります。