@Override public DirContextOperations authenticate(Authentication authentication) { if (userFilter == null || userFilter.equals("")) { // authenticate using dn return super.authenticate(authentication); } else { return authenticateUsingFilter(authentication); } }
new GeoserverLdapBindAuthenticator(ldapContext); authenticator.setUserFilter(ldapConfig.getUserFilter()); authenticator.setUserFormat(ldapConfig.getUserFormat()); authenticator.setUserDnPatterns(new String[] {ldapConfig.getUserDnPattern()});
String userDnStr = ""; try { ctx = getContextSource().getContext(username, password); handleBindException(userDnStr, username, e); } else { throw e;