6.2.2. LDAP レルム
LDAP レルムは、OpenLDAP、Red Hat Directory Server、Apache Directory Server、Microsoft Active Directory などの LDAP サーバーに接続して、ユーザーを認証し、メンバーシップ情報を取得します。
LDAP サーバーは、サーバーのタイプとデプロイメントに応じて、異なるエントリーレイアウトを持つことができます。このため、LDAP レルム設定は複雑です。すべてのポジションの設定の例を提供するために、本書では扱いません。
LDAP レルム設定
<security xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:infinispan:server:10.1 https://infinispan.org/schemas/infinispan-server-10.1.xsd"
xmlns="urn:infinispan:server:10.1">
<security-realms>
<security-realm name="default">
<ldap-realm name="ldap"
url="ldap://my-ldap-server:10389"
principal="uid=admin,ou=People,dc=infinispan,dc=org"
credential="strongPassword"
connection-timeout="3000" read-timeout="30000"
connection-pooling="true" referral-mode="ignore"
page-size="30"
direct-verification="true">
<identity-mapping rdn-identifier="uid"
search-dn="ou=People,dc=infinispan,dc=org">
<attribute-mapping>
<attribute from="cn"
to="Roles"
filter="(&(objectClass=groupOfNames)(member={1}))"
filter-dn="ou=Roles,dc=infinispan,dc=org"/>
</attribute-mapping>
</identity-mapping>
</ldap-realm>
</security-realm>
</security-realms>
</security>
- 1
- LDAP レルムに名前を付けます。
- 2
- LDAP サーバー接続 URL を指定します。
- 3
- LDAP サーバーに接続するためのプリンシパルおよび認証情報を指定します。重要
LDAP 接続のプリンシパルには、LDAP クエリーを実行し、特定の属性にアクセスするために必要な権限が必要です。
- 4
- 必要に応じて、接続タイムアウトなどを指定して LDAP サーバー接続を調整します。
- 5
- ユーザーの認証情報を検証します。Data Grid は設定済みの認証情報を使用して LDAP サーバーへの接続を試みます。または、パスワードを指定する
user-password-mapper要素を使用することもできます。 - 6
- LDAP エントリーをアイデンティティーにマッピングします。
rdn-identifierは、指定された識別子 (通常はユーザー名) をもとにユーザーエントリーを検索する LDAP 属性を指定します (例:uidまたはsAMAccountName属性)。 - 7
- ユーザーエントリーを含む LDAP サブツリーへの検索を制限する開始コンテキストを定義します。
- 8
- ユーザーがメンバーとなっている全グループを取得します。通常、メンバーシップ情報を保存する方法は 2 つあります。
-
通常、
member属性にクラスgroupOfNamesを持つグループエントリーの下。この場合は、前述の設定例にあるように、属性フィルターを使用できます。このフィルターは、提供されたフィルターに一致するエントリーを検索します。フィルターは、ユーザーの DN と等しいmember属性を持つグループを検索します。次に、フィルターは、fromで指定されたグループエントリーの CN を抽出し、それをユーザーのRolesに追加します。 memberOf属性のユーザーエントリー。この場合、以下のような属性参照を使用する必要があります。<attribute-reference reference="memberOf" from="cn" to="Roles" />この参照は、ユーザーエントリーからすべての
memberOf属性を取得し、fromで指定された CN を抽出し、それらをユーザーのRolesに追加します。
-
通常、
サポート対象の認証メカニズム
LDAP レルムは、以下の認証メカニズムを直接サポートします。
-
SASL:
PLAIN、DIGEST-*、およびSCRAM-* -
HTTP(REST):
BasicおよびDigest
6.2.2.1. LDAP レルムプリンシパルの書き換え リンクのコピーリンクがクリップボードにコピーされました!
GSSAPI、GS2-KRB5、Negotiate などの一部の SASL 認証メカニズムでは、LDAP サーバーの検索に使用する前に クリーンアップ する必要のあるユーザー名を提供します。
<security xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:infinispan:server:10.1 https://infinispan.org/schemas/infinispan-server-10.1.xsd"
xmlns="urn:infinispan:server:10.1">
<security-realms>
<security-realm name="default">
<ldap-realm name="ldap"
url="ldap://${org.infinispan.test.host.address}:10389"
principal="uid=admin,ou=People,dc=infinispan,dc=org"
credential="strongPassword">
<name-rewriter>
<regex-principal-transformer name="domain-remover"
pattern="(.*)@INFINISPAN\.ORG"
replacement="$1"/>
</name-rewriter>
<identity-mapping rdn-identifier="uid"
search-dn="ou=People,dc=infinispan,dc=org">
<attribute-mapping>
<attribute from="cn" to="Roles"
filter="(&(objectClass=groupOfNames)(member={1}))"
filter-dn="ou=Roles,dc=infinispan,dc=org" />
</attribute-mapping>
<user-password-mapper from="userPassword" />
</identity-mapping>
</ldap-realm>
</security-realm>
</security-realms>
</security>
- 1
- 正規表現を使用してプリンシパルからユーザー名を抽出するリライトを定義します。