Package org.springframework.security.ldap.search

Examples of org.springframework.security.ldap.search.FilterBasedLdapUserSearch


    private LdapUserSearch createUserSearch() {
        if(userSearchFilter == null) {
            return null;
        }
        return new FilterBasedLdapUserSearch(userSearchBase, userSearchFilter, contextSource);
    }
View Full Code Here


    }

    @Test
    public void testAuthenticationWithUserSearch() throws Exception {
        //DirContextAdapter ctx = new DirContextAdapter(new DistinguishedName("uid=bob,ou=people"));
        authenticator.setUserSearch(new FilterBasedLdapUserSearch("ou=people", "(uid={0})", getContextSource()));
        authenticator.afterPropertiesSet();
        authenticator.authenticate(bob);
        // SEC-1444
        authenticator.setUserSearch(new FilterBasedLdapUserSearch("ou=people", "(cn={0})", getContextSource()));
        authenticator.authenticate(new UsernamePasswordAuthenticationToken("mouse, jerry", "jerryspassword"));
        authenticator.authenticate(new UsernamePasswordAuthenticationToken("slash/guy", "slashguyspassword"));
        // SEC-1661
        authenticator.setUserSearch(new FilterBasedLdapUserSearch("ou=\\\"quoted people\\\"", "(cn={0})", getContextSource()));
        authenticator.authenticate(new UsernamePasswordAuthenticationToken("quote\"guy", "quoteguyspassword"));
        authenticator.setUserSearch(new FilterBasedLdapUserSearch("", "(cn={0})", getContextSource()));
        authenticator.authenticate(new UsernamePasswordAuthenticationToken("quote\"guy", "quoteguyspassword"));
    }
View Full Code Here

      //TODO change properties
      String userSearchBase = ldapServerProperties.get().getUserSearchBase();
      String userSearchFilter = ldapServerProperties.get().getUserSearchFilter();

      FilterBasedLdapUserSearch userSearch = new FilterBasedLdapUserSearch(userSearchBase, userSearchFilter, springSecurityContextSource);

      BindAuthenticator bindAuthenticator = new BindAuthenticator(springSecurityContextSource);
      bindAuthenticator.setUserSearch(userSearch);

      LdapAuthenticationProvider authenticationProvider = new LdapAuthenticationProvider(bindAuthenticator, authoritiesPopulator);
View Full Code Here

      //TODO change properties
      String userSearchBase = ldapServerProperties.get().getUserSearchBase();
      String userSearchFilter = ldapServerProperties.get().getUserSearchFilter();

      FilterBasedLdapUserSearch userSearch = new FilterBasedLdapUserSearch(userSearchBase, userSearchFilter, springSecurityContextSource);

      AmbariLdapBindAuthenticator bindAuthenticator = new AmbariLdapBindAuthenticator(springSecurityContextSource, configuration);
      bindAuthenticator.setUserSearch(userSearch);

      LdapAuthenticationProvider authenticationProvider = new LdapAuthenticationProvider(bindAuthenticator, authoritiesPopulator);
View Full Code Here

public class DefaultLdapUserRoleListServiceTests extends AbstractPentahoLdapIntegrationTests {

  private static final Log logger = LogFactory.getLog( DefaultLdapUserRoleListServiceTests.class );

  private LdapUserSearch getUserSearch( final String searchBase, final String searchFilter ) {
    return new FilterBasedLdapUserSearch( searchBase, searchFilter, getContextSource() );
  }
View Full Code Here

      //TODO change properties
      String userSearchBase = ldapServerProperties.get().getUserSearchBase();
      String userSearchFilter = ldapServerProperties.get().getUserSearchFilter();

      FilterBasedLdapUserSearch userSearch = new FilterBasedLdapUserSearch(userSearchBase, userSearchFilter, springSecurityContextSource);

      AmbariLdapBindAuthenticator bindAuthenticator = new AmbariLdapBindAuthenticator(springSecurityContextSource, configuration);
      bindAuthenticator.setUserSearch(userSearch);

      LdapAuthenticationProvider authenticationProvider = new LdapAuthenticationProvider(bindAuthenticator, authoritiesPopulator);
View Full Code Here

    private LdapUserSearch createUserSearch() {
        if(userSearchFilter == null) {
            return null;
        }
        return new FilterBasedLdapUserSearch(userSearchBase, userSearchFilter, contextSource);
    }
View Full Code Here

TOP

Related Classes of org.springframework.security.ldap.search.FilterBasedLdapUserSearch

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.