8000 Use the person directory resolver for ldap authentication by mmoayyed · Pull Request #1873 · apereo/cas · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Use the person directory resolver for ldap authentication #1873

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 12, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.ldap.UnsupportedAuthenticationMechanismException;
import org.apereo.cas.authentication.LdapAuthenticationHandler;
import org.apereo.cas.authentication.principal.PrincipalResolver;
import org.apereo.cas.authentication.support.PasswordPolicyConfiguration;
import org.apereo.cas.authorization.generator.LdapAuthorizationGenerator;
import org.apereo.cas.configuration.CasConfigurationProperties;
Expand Down Expand Up @@ -73,6 +74,10 @@ public class LdapAuthenticationConfiguration {
@Autowired
private CasConfigurationProperties casProperties;

@Autowired
@Qualifier("personDirectoryPrincipalResolver")
private PrincipalResolver personDirectoryPrincipalResolver;

@Autowired
@Qualifier("authenticationHandlersResolvers")
private Map authenticationHandlersResolvers;
Expand Down Expand Up @@ -131,9 +136,12 @@ public void initLdapAuthenticationHandlers() {
handler.setPasswordPolicyConfiguration(this.ldapPasswordPolicyConfiguration);
}
handler.setAuthenticator(authenticator);
handler.setPasswordEncoder(Beans.newPasswordEncoder(l.getPasswordEncoder()));

this.authenticationHandlersResolvers.put(handler, null);

if (l.getAdditionalAttributes().isEmpty() && l.getPrincipalAttributeList().isEmpty()) {
this.authenticationHandlersResolvers.put(handler, this.personDirectoryPrincipalResolver);
} else {
this.authenticationHandlersResolvers.put(handler, null);
}
}
});
}
Expand Down
0