elytron wildfly 的問題身份驗證 ==> 我使用舊版本的 wildfy 配置的LEGACY身份驗證 ldap 運行良好,并且僅對特定組的超級用戶部分進行了身份驗證
切換到支持 elytron 的wildfly 26后,我面臨身份驗證問題,我必須僅對屬于某個組的超級用戶進行身份驗證,而不是所有用戶,但我所做的配置需要并訪問所有用戶,我不想要要做到這一點,我將向您展示: LEGACY CONFIG
<security-realm name="realmx">
<authentication>
<ldap connection="ldap-connection" base-dn="CN=Users,dc=com,dc=global" recursive="true">
<advanced-filter filter="(&(sAMAccountName={0})(memberOf=CN=tfff wildfly Admins,CN=Users,dc=com,dc=global))"/>
</ldap>
</authentication>
</security-realm>
</security-realms>
<outbound-connections>
<ldap name="ldap-connection" url=" ldap://xxxxxxx" search-dn="CN=WEBAPP,CN=Users, dc=com,dc=global" search-credential="pass"/>
</outbound-connections>
ELYTRON:配置
<ldap-realm name="LdapRealm" dir-context="exampleDC" direct-verification="true">
<identity-mapping rdn-identifier="sAMAccountName" use-recursive-search="false" search-base-dn="cn=Users,dc=com,dc=global">
<attribute-mapping>
<attribute from="cn" to="Roles" filter="(member={1})" filter-base-dn="cn=Users,dc=com,dc=global"/>
</attribute-mapping>
<user-password-mapper from="userPassword"/>
</identity-mapping>
....
<dir-context name="exampleDC" url="ldap://xxxx" principal="CN=WEBAPP,cn=Users,dc=com,dc=global">
<credential-reference clear-text="pass"/>
uj5u.com熱心網友回復:
在identity-mapping配置中,我認為您需要添加filter-name屬性并將其設定為 "(&(sAMAccountName={0})(memberOf=CN=tfff wildfly Admins,CN=Users,dc=com,dc=global))".
然后,在attribute-mapping配置中,filter可以設定為 "(&(objectClass=group)(member={1}))"。
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/494914.html
