Search in sources :

Example 1 with SsoAuthenticator

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);
    }
}
Also used : SsoAuthenticator(org.codelibs.fess.sso.SsoAuthenticator) FessUser(org.codelibs.fess.entity.FessUser)

Aggregations

FessUser (org.codelibs.fess.entity.FessUser)1 SsoAuthenticator (org.codelibs.fess.sso.SsoAuthenticator)1