diff --git a/core/src/main/java/org/apache/sqoop/security/AuthenticationManager.java b/core/src/main/java/org/apache/sqoop/security/AuthenticationManager.java index 1f7248b9..a014ab30 100644 --- a/core/src/main/java/org/apache/sqoop/security/AuthenticationManager.java +++ b/core/src/main/java/org/apache/sqoop/security/AuthenticationManager.java @@ -28,6 +28,11 @@ public class AuthenticationManager implements Reconfigurable { private static final Logger LOG = Logger.getLogger(AuthenticationManager.class); + /** + * Default authentication handler + */ + public static final String DEFAULT_AUTHENTICATION_HANDLER = "org.apache.sqoop.security.SimpleAuthenticationHandler"; + /** * Default authentication auto upgrade option value @@ -86,7 +91,9 @@ public synchronized void initialize() throws ClassNotFoundException, IllegalAcce LOG.trace("Begin authentication manager initialization"); } - String handler = SqoopConfiguration.getInstance().getContext().getString(AuthenticationConstants.AUTHENTICATION_HANDLER.trim()); + String handler = SqoopConfiguration.getInstance().getContext().getString( + AuthenticationConstants.AUTHENTICATION_HANDLER, + DEFAULT_AUTHENTICATION_HANDLER).trim(); authenticationHandler = AuthenticationHandlerFactory.getAuthenticationHandler(handler); authenticationHandler.doInitialize(); authenticationHandler.secureLogin(); diff --git a/dist/src/main/server/conf/sqoop.properties b/dist/src/main/server/conf/sqoop.properties index 3d18e7bc..26bf7340 100755 --- a/dist/src/main/server/conf/sqoop.properties +++ b/dist/src/main/server/conf/sqoop.properties @@ -144,8 +144,8 @@ org.apache.sqoop.execution.engine=org.apache.sqoop.execution.mapreduce.Mapreduce # # Authentication configuration # -org.apache.sqoop.authentication.type=SIMPLE -org.apache.sqoop.authentication.handler=org.apache.sqoop.security.SimpleAuthenticationHandler +#org.apache.sqoop.authentication.type=SIMPLE +#org.apache.sqoop.authentication.handler=org.apache.sqoop.security.SimpleAuthenticationHandler #org.apache.sqoop.anonymous=true #org.apache.sqoop.authentication.type=KERBEROS #org.apache.sqoop.authentication.handler=org.apache.sqoop.security.KerberosAuthenticationHandler diff --git a/server/src/main/java/org/apache/sqoop/filter/SqoopAuthenticationFilter.java b/server/src/main/java/org/apache/sqoop/filter/SqoopAuthenticationFilter.java index 4165b866..bb662904 100644 --- a/server/src/main/java/org/apache/sqoop/filter/SqoopAuthenticationFilter.java +++ b/server/src/main/java/org/apache/sqoop/filter/SqoopAuthenticationFilter.java @@ -40,7 +40,8 @@ protected Properties getConfiguration(String configPrefix, Properties properties = super.getConfiguration(configPrefix, filterConfig); MapContext mapContext = SqoopConfiguration.getInstance().getContext(); String type = mapContext.getString( - AuthenticationConstants.AUTHENTICATION_TYPE).trim(); + AuthenticationConstants.AUTHENTICATION_TYPE, + AuthenticationConstants.TYPE.SIMPLE.name()).trim(); if (type.equalsIgnoreCase(AuthenticationConstants.TYPE.KERBEROS.name())) { properties.setProperty(AUTH_TYPE, AuthenticationConstants.TYPE.KERBEROS.name().toLowerCase());