Search in sources :

Example 1 with LdapRecommendedSettingsField

use of org.codice.ddf.admin.ldap.fields.query.LdapRecommendedSettingsField in project admin-console-beta by connexta.

the class LdapRecommendedSettings method performFunction.

@Override
public LdapRecommendedSettingsField performFunction() {
    LdapConnectionAttempt connectionAttempt = utils.bindUserToLdapConnection(conn, creds);
    addResultMessages(connectionAttempt.messages());
    if (!connectionAttempt.connection().isPresent()) {
        return null;
    }
    ServerGuesser guesser = ServerGuesser.buildGuesser(ldapType.getValue(), connectionAttempt.connection().get());
    return new LdapRecommendedSettingsField().userDns(guesser.getUserBaseChoices()).groupDns(guesser.getGroupBaseChoices()).userNameAttributes(guesser.getUserNameAttribute()).groupObjectClasses(guesser.getGroupObjectClass()).groupAttributesHoldingMember(guesser.getGroupAttributeHoldingMember()).memberAttributesReferencedInGroup(guesser.getMemberAttributeReferencedInGroup()).queryBases(guesser.getBaseContexts());
}
Also used : LdapRecommendedSettingsField(org.codice.ddf.admin.ldap.fields.query.LdapRecommendedSettingsField) LdapConnectionAttempt(org.codice.ddf.admin.ldap.commons.LdapConnectionAttempt) ServerGuesser(org.codice.ddf.admin.ldap.commons.ServerGuesser)

Aggregations

LdapConnectionAttempt (org.codice.ddf.admin.ldap.commons.LdapConnectionAttempt)1 ServerGuesser (org.codice.ddf.admin.ldap.commons.ServerGuesser)1 LdapRecommendedSettingsField (org.codice.ddf.admin.ldap.fields.query.LdapRecommendedSettingsField)1