5
0
mirror of https://github.com/apache/sqoop.git synced 2025-05-05 05:09:46 +08:00

SQOOP-1774: Sqoop2: Allow anonymous authentication

(Abraham Elmahrek via Jarek Jarcec Cecho)
This commit is contained in:
Jarek Jarcec Cecho 2014-11-20 20:16:07 -08:00
parent 3349ae263d
commit 39ab0a6f25
3 changed files with 10 additions and 0 deletions

View File

@ -47,6 +47,13 @@ public final class AuthenticationConstants {
public static final String AUTHENTICATION_HANDLER =
PREFIX_AUTHENTICATION_CONFIG + "handler";
/**
* The config enables or disables anonymous authentication.
* <tt>org.apache.sqoop.authentication.anonymous</tt>.
*/
public static final String AUTHENTICATION_ANONYMOUS =
PREFIX_AUTHENTICATION_CONFIG + "anonymous";
/**
* All kerberos authentication related configuration is prefixed with this:
* <tt>org.apache.sqoop.authentication.kerberos.</tt>

View File

@ -146,6 +146,7 @@ org.apache.sqoop.execution.engine=org.apache.sqoop.execution.mapreduce.Mapreduce
#
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
#org.apache.sqoop.authentication.kerberos.principal=sqoop/_HOST@NOVALOCAL

View File

@ -71,6 +71,8 @@ protected Properties getConfiguration(String configPrefix,
properties.setProperty(KerberosAuthenticationHandler.KEYTAB, keytab);
} else if (type.equalsIgnoreCase(AuthenticationConstants.TYPE.SIMPLE.name())) {
properties.setProperty(AUTH_TYPE, PseudoAuthenticationHandler.class.getName());
properties.setProperty(PseudoAuthenticationHandler.ANONYMOUS_ALLOWED,
mapContext.getString(AuthenticationConstants.AUTHENTICATION_ANONYMOUS, "true").trim());
} else {
throw new SqoopException(AuthenticationError.AUTH_0004, type);
}