@Override public void configure(AuthenticationManagerBuilder auth) throws Exception { auth .ldapAuthentication() .userDnPatterns("uid={0},ou=people") .groupSearchBase("ou=groups") .contextSource() .url("ldap://localhost:8389/dc=springframework,dc=org") .and() .passwordCompare() .passwordEncoder(new LdapShaPasswordEncoder()) .passwordAttribute("userPassword"); }
.groupRoleAttribute(groupRoleAttribute) .groupSearchFilter(groupSearchFilter) .groupSearchBase(groupSearchBase) .contextSource() .url(providerUrl)
@Autowired public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception { if (ShepherConstants.LOGIN_TYPE_LDAP.equals(loginType.toUpperCase())) { auth.ldapAuthentication() .userDnPatterns("uid={0},ou=people") .groupSearchBase("ou=groups") .contextSource() .url(ldapUrl) .managerPassword(ldapPassword) .managerDn(ldapDn); } else if (ShepherConstants.LOGIN_TYPE_DEMO.equals(loginType.toUpperCase())) { auth.inMemoryAuthentication() .withUser(demoAdminName) .password(demoAdminPassword) .roles("USER"); } } }
.groupSearchBase(environment.getProperty("security.providers[" + providerIdx + "].group-search-base", "")) .groupSearchFilter(environment.getProperty("security.providers[" + providerIdx + "].group-search-filter", "(uniqueMember={0})")) .groupRoleAttribute(environment.getProperty("security.providers[" + providerIdx + "].group-role-attribute", "cn"))
@Override public void configure(AuthenticationManagerBuilder auth) throws Exception { auth .ldapAuthentication() .userSearchFilter("(sAMAccountName={0})") .userSearchBase("OU=Mirante User,DC=miranteinfo,DC=com") .rolePrefix("ROLE_") .groupSearchBase("OU=GruposGS,DC=miranteinfo,DC=com") .groupSearchFilter("(member={0})") .userDetailsContextMapper(peticionamentoUserDetailService.orElseThrow(() -> SingularServerException.rethrow( String.format("Bean %s do tipo %s não pode ser nulo. Para utilizar a configuração de segurança %s é preciso declarar um bean do tipo %s identificado pelo nome %s .", SingularUserDetailsService.class.getName(), "SingularUserDetailsService", SingularMiranteADSpringSecurityConfig.class.getName(), SingularUserDetailsService.class.getName(), "SingularUserDetailsService" )) ) ) .contextSource() .managerDn("tomcatLogin") .managerPassword("jnditomcat") .root("DC=miranteinfo,DC=com") .url("ldap://LUA.miranteinfo.com:389/"); }
.userDnPatterns(ldapAppProperties.getUserDnPattern()) .groupRoleAttribute(ldapAppProperties.getGroupRoleAttribute()) .groupSearchBase(ldapAppProperties.getGroupSearchBase()) .contextSource() .url(ldapAppProperties.getUrl())
ldapConfigurer.groupSearchBase(ldapSecurityProperties.getGroupSearchBase()) .groupSearchFilter(ldapSecurityProperties.getGroupSearchFilter()) .groupRoleAttribute(ldapSecurityProperties.getGroupRoleAttribute());