LDAP 認証メカニズムでは、ユーザー(およびパスワード)とロール(またはグループ)は、Active Directory または LDAP ドメインから ロードされます。
Encrypting Credentials in the Configuration
dvserver-standalone.xmlで定義された資格情報をエンコードするには、次のようにします:
1. CLI コマンドでパスワードを暗号化します:
CALL SYSADMIN.executeCli(script =>
'/subsystem=elytron/expression=encryption:create-expression(resolver=dv-encryption-resolver, clear-text=Password123)'
,
"maskInLogs"
=>
true
) ;;
出力は以下のようになります:
{
"outcome"
=>
"success"
,
"result"
=> {
"expression"
=>
"${ENC::dv-encryption-resolver:RUxZAUMQ42XclErCI4BDa6nzzp/r/aqx31Cu/aNwUjvCgr5Tofw=}"
}
}
2. 以下のように、設定ファイルで使用する式の値をコピーします:
<dir-contexts>
<dir-context name=
"ldap-connection"
principal=
"CN=Administrator,CN=Users,DC=mydomain,DC=local"
url=
"ldap://192.168.222.102/"
>
<credential-reference clear-text=
"${ENC::dv-encryption-resolver:RUxZAUMQ42XclErCI4BDa6nzzp/r/aqx31Cu/aNwUjvCgr5Tofw=}"
/>
</dir-context>
</dir-contexts>
Configuration
LDAP 認証を構成するには、dvserver-standalone.xml を以下のように変更してください:
1. 以下のコードを:
<custom-realm
class
-name=
"com.datavirtuality.dv.core.teiid.users.DVLoginModule"
module=
"com.datavirtuality.dv"
name=
"DataVirtualityRealm"
/>
To search for this line, use "custom-realm" as your search term as the actual order of elements may differ.
このようなスニペットで置き換えます:
<ldap-realm dir-context=
"ldap-connection"
direct-verification=
"true"
name=
"DataVirtualityRealm"
>
<identity-mapping rdn-identifier=
"cn"
search-base-dn=
"DC=mydomain,DC=local"
use-recursive-search=
"true"
>
<attribute-mapping>
<attribute filter=
"(member={1})"
filter-base-dn=
"OU=Users,DC=mydomain,DC=local"
from=
"cn"
to=
"Roles"
/>
</attribute-mapping>
</identity-mapping>
</ldap-realm>
フィルタベースの認証は、次のように設定できます。
<ldap-realm dir-context=
"ldap-connection"
direct-verification=
"true"
name=
"DataVirtualityRealm"
>
<identity-mapping filter-name=
"(userPrincipalName={0}@mydomain.local)"
rdn-identifier=
"userPrincipalName"
use-recursive-search=
"true"
search-base-dn=
"DC=mydomain,DC=local"
>
<attribute-mapping>
<attribute filter=
"(member={1})"
filter-base-dn=
"OU=Users,DC=mydomain,DC=local"
from=
"cn"
to=
"Roles"
/>
</attribute-mapping>
</identity-mapping>
</ldap-realm>
上記のフラグメントの値は、環境の設定に合わせて調整してください。
2. </expression-resolver> タグを見つけて以下のコードを貼り付けます。その際、必要な部分を自分の値に置き換えてください:
<dir-contexts>
<dir-context name=
"ldap-connection"
principal=
"CN=Administrator,CN=Users,DC=mydomain,DC=local"
url=
"ldap://192.168.0.68/"
>
<credential-reference clear-text=
"Password123"
/>
</dir-context>
</dir-contexts>
3. </policy-decider-module> タグを見つけ、以下のコードを挿入します:
<ldap>
<property name=
"defaultAdminGroup"
value=
"super-group"
/>
<property name=
"displayUserName"
value=
"cn"
/>
<property name=
"roleRecursion"
value=
"5"
/>
</ldap>
DVLdapExtContext
とDVLdapContext
がサポートするその他のプロパティは、このセクションで追加できます。
例えば、システムでユーザー名を表示するための条件付きルールを設定するには、以下のプロパティを設定します:
<property name=
"displayUserName"
value=
"has('userPrincipalName') ? stripDomain(userPrincipalName) : distinguishedName"
/>