Skip to content

Commit

Permalink
KARAF-2540 - LDAP authentication defaults to null if not specified
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/karaf/trunk@1537209 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
janstey committed Oct 30, 2013
1 parent 9d50443 commit fafa69e
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
*/
public class LDAPLoginModule extends AbstractKarafLoginModule {

private static final String DEFAULT_AUTHENTICATION = "simple";

private static Logger logger = LoggerFactory.getLogger(LDAPLoginModule.class);

public final static String CONNECTION_URL = "connection.url";
Expand Down Expand Up @@ -78,7 +80,7 @@ public class LDAPLoginModule extends AbstractKarafLoginModule {
private String roleFilter;
private String roleNameAttribute;
private boolean roleSearchSubtree = true;
private String authentication = "simple";
private String authentication = DEFAULT_AUTHENTICATION;
private String initialContextFactory = null;
private boolean ssl;
private String sslProvider;
Expand Down Expand Up @@ -106,6 +108,9 @@ public void initialize(Subject subject, CallbackHandler callbackHandler, Map<Str
initialContextFactory = DEFAULT_INITIAL_CONTEXT_FACTORY;
}
authentication = (String) options.get(AUTHENTICATION);
if (authentication == null) {
authentication = DEFAULT_AUTHENTICATION;
}
if (connectionURL == null || connectionURL.trim().length() == 0) {
logger.error("No LDAP URL specified.");
} else if (!connectionURL.startsWith("ldap:") && !connectionURL.startsWith("ldaps:")) {
Expand Down

0 comments on commit fafa69e

Please sign in to comment.