Beispiel #1
0
        public virtual void testFilterByGroupMemberPosix()
        {
            // by default the configuration does not use posix groups
            LdapConfiguration ldapConfiguration = new LdapConfiguration();

            ldapConfiguration.GroupMemberAttribute = "memberUid";
            ldapConfiguration.GroupSearchFilter    = "(someFilter)";

            LdapIdentityProviderSession session = new LdapIdentityProviderSessionAnonymousInnerClass(this, ldapConfiguration);

            // if I query for groups by group member
            LdapGroupQuery query = new LdapGroupQuery();

            query.groupMember("jonny");

            // then the full DN is requested. This is the default behavior.
            string filter = session.getGroupSearchFilter(query);

            assertEquals("(&(someFilter)(memberUid=jonny, fullDn))", filter);

            // If I turn on posix groups
            ldapConfiguration.UsePosixGroups = true;

            //  then the filter string does not contain the full DN for the
            // user but the simple (unqualified) userId as provided in the query
            filter = session.getGroupSearchFilter(query);
            assertEquals("(&(someFilter)(memberUid=jonny))", filter);
        }
Beispiel #2
0
 public LdapIdentityProviderSession(LdapConfiguration ldapConfiguration)
 {
     this.ldapConfiguration = ldapConfiguration;
 }