private boolean isKerberosAuthMode(String authType) { return authType.equalsIgnoreCase(HiveAuthFactory.AuthTypes.KERBEROS.toString()); }
private boolean isKerberosAuthMode(String authType) { return authType.equalsIgnoreCase(HiveAuthFactory.AuthTypes.KERBEROS.toString()); }
private boolean isKerberosAuthMode(String authType) { return authType.equalsIgnoreCase(HiveAuthFactory.AuthTypes.KERBEROS.toString()); }
.equals(HiveAuthFactory.AuthTypes.KERBEROS.toString())) {
/** * Do passwd auth. * * @param userName the user name * @param password the password */ private void doPasswdAuth(String userName, String password) { // Lens confs to Hive Confs. for (ConfVars var : new ConfVars[]{ConfVars.HIVE_SERVER2_PLAIN_LDAP_DOMAIN}) { if (cliService.getHiveConf().getVar(var) == null) { cliService.getHiveConf().setVar(var, cliService.getHiveConf().get(LensConfConstants.SERVER_DOMAIN)); } } String authType = getHiveConf().getVar(ConfVars.HIVE_SERVER2_AUTHENTICATION); // No-op when authType is NOSASL if (!authType.equalsIgnoreCase(HiveAuthFactory.AuthTypes.NOSASL.toString())) { try { AuthenticationProviderFactory.AuthMethods authMethod = AuthenticationProviderFactory.AuthMethods .getValidAuthMethod(authType); PasswdAuthenticationProvider provider = AuthenticationProviderFactory .getAuthenticationProvider(authMethod, getHiveConf()); provider.Authenticate(userName, password); } catch (Exception e) { log.error("Auth error: ", e); throw new NotAuthorizedException(e); } } }
@Override public CLIServiceClient getClient() throws LensException { if (!connected) { try { log.info("HiveDriver connecting to HiveServer @ {}:{}", conf.getVar(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_BIND_HOST), conf.getIntVar(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_PORT)); if (conf.getVar(HiveConf.ConfVars.HIVE_SERVER2_AUTHENTICATION) .equals(HiveAuthFactory.AuthTypes.KERBEROS.toString())) { hs2Client = RetryingThriftCLIServiceClientSasl.newRetryingCLIServiceClient(conf); } else { hs2Client = RetryingThriftCLIServiceClient.newRetryingCLIServiceClient(conf); } log.info("HiveDriver connected to HiveServer @ {}:{}", conf.getVar(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_BIND_HOST), conf.getIntVar(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_PORT)); } catch (Exception e) { throw new LensException(e); } connected = true; } return hs2Client; }
/** * Do the LDAP/PAM authentication * @param request * @param authType * @throws HttpAuthenticationException */ private String doPasswdAuth(HttpServletRequest request, String authType) throws HttpAuthenticationException { String userName = getUsername(request, authType); // No-op when authType is NOSASL if (!authType.equalsIgnoreCase(HiveAuthFactory.AuthTypes.NOSASL.toString())) { try { AuthMethods authMethod = AuthMethods.getValidAuthMethod(authType); PasswdAuthenticationProvider provider = AuthenticationProviderFactory.getAuthenticationProvider(authMethod); provider.Authenticate(userName, getPassword(request, authType)); } catch (Exception e) { throw new HttpAuthenticationException(e); } } return userName; }
/** * Do the LDAP/PAM authentication * @param request * @param authType * @throws HttpAuthenticationException */ private String doPasswdAuth(HttpServletRequest request, String authType) throws HttpAuthenticationException { String userName = getUsername(request, authType); // No-op when authType is NOSASL if (!authType.equalsIgnoreCase(HiveAuthFactory.AuthTypes.NOSASL.toString())) { try { AuthMethods authMethod = AuthMethods.getValidAuthMethod(authType); PasswdAuthenticationProvider provider = AuthenticationProviderFactory.getAuthenticationProvider(authMethod); provider.Authenticate(userName, getPassword(request, authType)); } catch (Exception e) { throw new HttpAuthenticationException(e); } } return userName; }
/** * Do the LDAP/PAM authentication * @param request * @param authType * @throws HttpAuthenticationException */ private String doPasswdAuth(HttpServletRequest request, String authType) throws HttpAuthenticationException { String userName = getUsername(request, authType); // No-op when authType is NOSASL if (!authType.equalsIgnoreCase(HiveAuthFactory.AuthTypes.NOSASL.toString())) { try { AuthMethods authMethod = AuthMethods.getValidAuthMethod(authType); PasswdAuthenticationProvider provider = AuthenticationProviderFactory.getAuthenticationProvider(authMethod); provider.Authenticate(userName, getPassword(request, authType)); } catch (Exception e) { throw new HttpAuthenticationException(e); } } return userName; }
/** * Do the LDAP/PAM authentication * @param request * @param authType * @throws HttpAuthenticationException */ private String doPasswdAuth(HttpServletRequest request, String authType) throws HttpAuthenticationException { String userName = getUsername(request, authType); // No-op when authType is NOSASL if (!authType.equalsIgnoreCase(HiveAuthFactory.AuthTypes.NOSASL.toString())) { try { AuthMethods authMethod = AuthMethods.getValidAuthMethod(authType); PasswdAuthenticationProvider provider = AuthenticationProviderFactory.getAuthenticationProvider(authMethod); provider.Authenticate(userName, getPassword(request, authType)); } catch (Exception e) { throw new HttpAuthenticationException(e); } } return userName; }
private boolean isKerberosAuthMode(String authType) { return authType.equalsIgnoreCase(HiveAuthFactory.AuthTypes.KERBEROS.toString()); }
private String getDelegationToken(String userName) throws HiveSQLException, LoginException, IOException { if (userName == null || !cliService.getHiveConf().getVar(ConfVars.HIVE_SERVER2_AUTHENTICATION) .equalsIgnoreCase(HiveAuthFactory.AuthTypes.KERBEROS.toString())) { return null; } try { return cliService.getDelegationTokenFromMetaStore(userName); } catch (UnsupportedOperationException e) { // The delegation token is not applicable in the given deployment mode } return null; }
private String getDelegationToken(String userName) throws HiveSQLException, LoginException, IOException { if (userName == null || !cliService.getHiveConf().getVar(ConfVars.HIVE_SERVER2_AUTHENTICATION) .equalsIgnoreCase(HiveAuthFactory.AuthTypes.KERBEROS.toString())) { return null; } try { return cliService.getDelegationTokenFromMetaStore(userName); } catch (UnsupportedOperationException e) { // The delegation token is not applicable in the given deployment mode } return null; }
private String getDelegationToken(String userName) throws HiveSQLException, LoginException, IOException { if (userName == null || !cliService.getHiveConf().getVar(ConfVars.HIVE_SERVER2_AUTHENTICATION) .equalsIgnoreCase(HiveAuthFactory.AuthTypes.KERBEROS.toString())) { return null; } try { return cliService.getDelegationTokenFromMetaStore(userName); } catch (UnsupportedOperationException e) { // The delegation token is not applicable in the given deployment mode } return null; }
private String getDelegationToken(String userName) throws HiveSQLException, LoginException, IOException { if (userName == null || !cliService.getHiveConf().getVar(ConfVars.HIVE_SERVER2_AUTHENTICATION) .equalsIgnoreCase(HiveAuthFactory.AuthTypes.KERBEROS.toString())) { return null; } try { return cliService.getDelegationTokenFromMetaStore(userName); } catch (UnsupportedOperationException e) { // The delegation token is not applicable in the given deployment mode } return null; }
private boolean isKerberosAuthMode() { return cliService.getHiveConf().getVar(ConfVars.HIVE_SERVER2_AUTHENTICATION) .equalsIgnoreCase(HiveAuthFactory.AuthTypes.KERBEROS.toString()); } }
private boolean isKerberosAuthMode() { return cliService.getHiveConf().getVar(ConfVars.HIVE_SERVER2_AUTHENTICATION) .equalsIgnoreCase(HiveAuthFactory.AuthTypes.KERBEROS.toString()); } }
private boolean isKerberosAuthMode() { return cliService.getHiveConf().getVar(ConfVars.HIVE_SERVER2_AUTHENTICATION) .equalsIgnoreCase(HiveAuthFactory.AuthTypes.KERBEROS.toString()); } }
private boolean isKerberosAuthMode() { return cliService.getHiveConf().getVar(ConfVars.HIVE_SERVER2_AUTHENTICATION) .equalsIgnoreCase(HiveAuthFactory.AuthTypes.KERBEROS.toString()); } }
@Override public Map<String, String> getAuthenticationConfig() { Map<String, String> result = new HashMap<>(); result.put(HiveConf.ConfVars.HIVE_SERVER2_KERBEROS_PRINCIPAL.varname, kerberosConfig.getTestPrincipal()); result.put(HiveConf.ConfVars.HIVE_SERVER2_KERBEROS_KEYTAB.varname, kerberosConfig.getKeytabFilePath()); result.put(HiveConf.ConfVars.HIVE_SERVER2_AUTHENTICATION.varname, HiveAuthFactory.AuthTypes.KERBEROS.toString()); result.put(CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHENTICATION, HiveAuthFactory.AuthTypes.KERBEROS.toString()); result.put(YarnConfiguration.RM_PRINCIPAL, kerberosConfig.getTestPrincipal()); return result; }