use of org.codelibs.fess.sso.SsoAuthenticator in project fess by codelibs.
the class FessLoginAssist method resolveCredential.
// ===================================================================================
// Login Extension
// ==============
@Override
protected void resolveCredential(final CredentialResolver resolver) {
resolver.resolve(LocalUserCredential.class, credential -> {
final LocalUserCredential userCredential = credential;
final String username = userCredential.getUser();
final String password = userCredential.getPassword();
if (!fessConfig.isAdminUser(username)) {
final OptionalEntity<FessUser> ldapUser = ComponentUtil.getLdapManager().login(username, password);
if (ldapUser.isPresent()) {
return ldapUser;
}
}
return doFindLoginUser(username, encryptPassword(password));
});
final LoginCredentialResolver loginResolver = new LoginCredentialResolver(resolver);
for (final SsoAuthenticator auth : ComponentUtil.getSsoManager().getAuthenticators()) {
auth.resolveCredential(loginResolver);
}
}
Aggregations