Examples of BindAuthenticator


Examples of org.acegisecurity.providers.ldap.authenticator.BindAuthenticator

              new FilterBasedLdapUserSearch(searchBase,
              searchFilter,
              initialDirContextFactory);
          userSearch.setSearchSubtree(true);
         
          BindAuthenticator authenticator = new BindAuthenticator(initialDirContextFactory);
          authenticator.setUserSearch(userSearch);
          authenticator.setUserDnPatterns(new String [] { "uid={0},ou=users"} );
         
          String groupSearchBase = "ou=groups";
          DefaultLdapAuthoritiesPopulator authoritiesPopulator =
            new DefaultLdapAuthoritiesPopulator(initialDirContextFactory,
                groupSearchBase);
          String groupRoleAttribute = "ou";
          authoritiesPopulator.setGroupRoleAttribute(groupRoleAttribute);
           
            System.out.println("***********************************");
          LdapAuthenticationProvider ldapAuthenticationProvider =
            new LdapAuthenticationProvider(authenticator, authoritiesPopulator);
          LdapUserInfo user = authenticator.authenticate(userDetails.getUsername(),
              (String)authentication.getCredentials());
          if (user != null) {
              UserDetails u = ldapAuthenticationProvider.retrieveUser(userDetails.getUsername(),
                  authentication);         
              System.out.println("user " + u);
View Full Code Here

Examples of org.springframework.security.ldap.authentication.BindAuthenticator

     * @param contextSource the {@link BaseLdapPathContextSource} to use
     * @return the {@link BindAuthenticator} to use
     */
    private BindAuthenticator createBindAuthenticator(
            BaseLdapPathContextSource contextSource) {
        return new BindAuthenticator(contextSource);
    }
View Full Code Here

Examples of org.springframework.security.ldap.authentication.BindAuthenticator

      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);

      providerThreadLocal.set(authenticationProvider);
    }
View Full Code Here

Examples of org.springframework.security.ldap.authentication.BindAuthenticator

     * @param contextSource the {@link BaseLdapPathContextSource} to use
     * @return the {@link BindAuthenticator} to use
     */
    private BindAuthenticator createBindAuthenticator(
            BaseLdapPathContextSource contextSource) {
        return new BindAuthenticator(contextSource);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.