English 中文(简体)
玻璃鱼3.1 灌木 活跃的董事团体成员
原标题:Glassfish 3.1 ldapRealm ActiveDirectory group membership

I m trying to implement ldapRealm on Glassfish 3.1. I can login fine with the following configuration, however I haven t been able to get AD s group membership correctly. I followed group memberships in (AD) ldap Realm to include group-search-filter but still not working.
Here s my web.xml :

<auth-realm name="ADREALM" classname="com.sun.enterprise.security.auth.realm.ldap.LDAPRealm">
    <property name="directory" value="ldap://domain.com:389"></property>
    <property name="search-filter" value="(&amp;(objectCategory=user)(sAMAccountName=%s))"></property>
    <property name="search-bind-dn" value="[email protected]"></property>
    <property description="null" name="base-dn" value="OU=CORP Users,DC=domain,DC=com"></property>
    <property name="group-search-filter" value="(&amp;(objectCategory=group)(member=%d))"></property>
    <property name="search-bind-password" value="password"></property>
    <property name="jaas-context" value="ldapRealm"></property>
</auth-realm>

我还在服务器-组合中添加以下选择:

-Djava.naming.referral=follow  

• 玻璃鱼 log:

FINE: [Web-Security] hasUserDataPermission perm: (javax.security.jacc.WebUserDataPermission /j_security_check POST)
FINE: [Web-Security] hasUserDataPermission isGranted: true
FINEST: Processing login with credentials of type: class com.sun.enterprise.security.auth.login.common.PasswordCredential
FINE: Logging in user [kip] into realm: ADREALM using JAAS module: ldapRealm
FINE: Login module initialized: class com.sun.enterprise.security.auth.login.LDAPLoginModule
FINE: search: baseDN: OU=CORP Users,DC=domain,DC=com  filter: (&(objectCategory=user)(sAMAccountName=kip))
FINE: Found user DN: CN=Kipling,OU=IT,OU=CORP Users,DC=domain,DC=com
FINE: LDAP:Group search filter: (&(objectCategory=group)(member=CN=Kipling,OU=IT,OU=CORP Users,DC=domain,DC=com))
FINE: LDAP: Group memberships found: 
FINE: LDAP: login succeeded for: kip
FINE: JAAS login complete.
FINE: JAAS authentication committed.
FINE: Password login succeeded for : kip
FINE: Set security context as user: kip  

专家组成员身份的通知是空洞的。 让我知道,是否需要更多信息。

最佳回答

Over the weekend, I figured out what was wrong with my ldapRealm configuration. Since I set my base-dn to users ou branch and group information is on different ou branch, glassfish couldn t find my groups dn. (too restrictive - also mentioned by one of SO s question). In order to get group-search-filter to work, i had to add additional property to ldapRealm, which is group-base-dn for group data retrieval.

<property name="group-base-dn" value="OU=CORP Groups,DC=domain,DC=com"></property>

因此,除非我制定<代码>基准-dn至基本<编码>DC=domain,DC=com。 我必须列入<代码>按组/底的财产。 这里我最后的几句:

<auth-realm name="ADREALM" classname="com.sun.enterprise.security.auth.realm.ldap.LDAPRealm">
    <property name="directory" value="ldap://domain.com:389"></property>
    <property name="jaas-context" value="ldapRealm"></property>
    <property name="base-dn" value="OU=CORP Users,DC=domain,DC=com" description="null"></property>
    <property name="search-filter" value="(&amp;(objectCategory=user)(sAMAccountName=%s))"></property>
    <property name="group-base-dn" value="OU=CORP Groups,DC=domain,DC=com"></property>
    <property name="group-search-filter" value="(&amp;(objectCategory=group)(member=%d))"></property>
    <property name="search-bind-dn" value="[email protected]"></property>
    <property name="search-bind-password" value="password"></property>
</auth-realm>  

我希望,这能够帮助任何人混淆红树。 感谢!

随附玻璃鱼记录:

FINE: search: baseDN: OU=CORP Users,DC=domain,DC=com  filter: (&(objectCategory=user)(sAMAccountName=kip))
FINE: Found user DN: CN=Kipling,OU=IT,OU=CORP Users,DC=domain,DC=com
FINE: LDAP:Group search filter: (&(objectCategory=group)(member=CN=Kipling,OU=IT,OU=CORP Users,DC=domain,DC=com))
FINE: LDAP: Group memberships found:  Application Administrators
FINE: LDAP: login succeeded for: kip
FINE: JAAS login complete.
FINE: JAAS authentication committed.
问题回答

objectClass=Group, not objectCategory=group in their searchfil。





相关问题
Force clear EJB3 cache in Glassfish

I have application written in Java that is using EJB3 + Toplink. I m using Glassfish as my app. server. Sometimes the data that has been cached is old and I need to clear my cache manually. I know ...

Which Maven GlassFish plugin to use?

I ve been trying to integrate deploying java .war s in GlassFish V3 through Maven. While I have found a few plugins, none of them look to be very active: Maven Glassfish Plugin Eskato s Wordpress ...

is it good to catch error in DAO?

public boolean checkInd() { int dis_ind = 2; HashMap parmMap = new HashMap(); //line below can generate errors getSqlMapClientTemplate().queryForList("authentication.checkInd", parmMap)...

Turn off TRACE in GlassFish v2

I need to turn off TRACE to help close XST security vulnerabilities. I ve been looking, nothing obvious so far. Any help?

Glassfish in a production environment?

Do you use Glassfish 2 or v3 in a production environment? Do you find it robust? Have you ever been able to find a complete set of documentation? What do you do when you find that Glassfish ignores ...

热门标签