@Override public void Authenticate(String user, String password) throws AuthenticationException { customProvider.Authenticate(user, password); }
@Override public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { String username = null; String password = null; AuthorizeCallback ac = null; for (Callback callback : callbacks) { if (callback instanceof NameCallback) { NameCallback nc = (NameCallback) callback; username = nc.getName(); } else if (callback instanceof PasswordCallback) { PasswordCallback pc = (PasswordCallback) callback; password = new String(pc.getPassword()); } else if (callback instanceof AuthorizeCallback) { ac = (AuthorizeCallback) callback; } else { throw new UnsupportedCallbackException(callback); } } PasswdAuthenticationProvider provider = AuthenticationProviderFactory.getAuthenticationProvider(authMethod); provider.Authenticate(username, password); if (ac != null) { ac.setAuthorized(true); } } }
/** * 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(HiveAuthConstants.AuthTypes.NOSASL.toString())) { try { AuthMethods authMethod = AuthMethods.getValidAuthMethod(authType); PasswdAuthenticationProvider provider = AuthenticationProviderFactory.getAuthenticationProvider(authMethod, hiveConf); provider.Authenticate(userName, getPassword(request, authType)); } catch (Exception e) { throw new HttpAuthenticationException(e); } } return userName; }
@Override public void Authenticate(String user, String password) throws AuthenticationException { customProvider.Authenticate(user, password); }
@Override public void Authenticate(String user, String password) throws AuthenticationException { customProvider.Authenticate(user, password); }
@Override public void Authenticate(String user, String password) throws AuthenticationException { customProvider.Authenticate(user, password); }
@Override public void Authenticate(String user, String password) throws AuthenticationException { customProvider.Authenticate(user, password); }
@Override public void Authenticate(String user, String password) throws AuthenticationException { customProvider.Authenticate(user, password); }
@Override public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { String username = null; String password = null; AuthorizeCallback ac = null; for (Callback callback : callbacks) { if (callback instanceof NameCallback) { NameCallback nc = (NameCallback) callback; username = nc.getName(); } else if (callback instanceof PasswordCallback) { PasswordCallback pc = (PasswordCallback) callback; password = new String(pc.getPassword()); } else if (callback instanceof AuthorizeCallback) { ac = (AuthorizeCallback) callback; } else { throw new UnsupportedCallbackException(callback); } } PasswdAuthenticationProvider provider = AuthenticationProviderFactory.getAuthenticationProvider(authMethod); provider.Authenticate(username, password); if (ac != null) { ac.setAuthorized(true); } } }
@Override public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { String username = null; String password = null; AuthorizeCallback ac = null; for (Callback callback : callbacks) { if (callback instanceof NameCallback) { NameCallback nc = (NameCallback) callback; username = nc.getName(); } else if (callback instanceof PasswordCallback) { PasswordCallback pc = (PasswordCallback) callback; password = new String(pc.getPassword()); } else if (callback instanceof AuthorizeCallback) { ac = (AuthorizeCallback) callback; } else { throw new UnsupportedCallbackException(callback); } } PasswdAuthenticationProvider provider = AuthenticationProviderFactory.getAuthenticationProvider(authMethod); provider.Authenticate(username, password); if (ac != null) { ac.setAuthorized(true); } } }
@Override public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { String username = null; String password = null; AuthorizeCallback ac = null; for (Callback callback : callbacks) { if (callback instanceof NameCallback) { NameCallback nc = (NameCallback) callback; username = nc.getName(); } else if (callback instanceof PasswordCallback) { PasswordCallback pc = (PasswordCallback) callback; password = new String(pc.getPassword()); } else if (callback instanceof AuthorizeCallback) { ac = (AuthorizeCallback) callback; } else { throw new UnsupportedCallbackException(callback); } } PasswdAuthenticationProvider provider = AuthenticationProviderFactory.getAuthenticationProvider(authMethod); provider.Authenticate(username, password); if (ac != null) { ac.setAuthorized(true); } } }
@Override public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { String username = null; String password = null; AuthorizeCallback ac = null; for (Callback callback : callbacks) { if (callback instanceof NameCallback) { NameCallback nc = (NameCallback) callback; username = nc.getName(); } else if (callback instanceof PasswordCallback) { PasswordCallback pc = (PasswordCallback) callback; password = new String(pc.getPassword()); } else if (callback instanceof AuthorizeCallback) { ac = (AuthorizeCallback) callback; } else { throw new UnsupportedCallbackException(callback); } } PasswdAuthenticationProvider provider = AuthenticationProviderFactory.getAuthenticationProvider(authMethod); provider.Authenticate(username, password); if (ac != null) { ac.setAuthorized(true); } } }
@Override public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { String username = null; String password = null; AuthorizeCallback ac = null; for (Callback callback : callbacks) { if (callback instanceof NameCallback) { NameCallback nc = (NameCallback) callback; username = nc.getName(); } else if (callback instanceof PasswordCallback) { PasswordCallback pc = (PasswordCallback) callback; password = new String(pc.getPassword()); } else if (callback instanceof AuthorizeCallback) { ac = (AuthorizeCallback) callback; } else { throw new UnsupportedCallbackException(callback); } } PasswdAuthenticationProvider provider = AuthenticationProviderFactory.getAuthenticationProvider(authMethod); provider.Authenticate(username, password); if (ac != null) { ac.setAuthorized(true); } } }
/** * 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; }
/** * 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(HiveAuthConstants.AuthTypes.NOSASL.toString())) { try { AuthMethods authMethod = AuthMethods.getValidAuthMethod(authType); PasswdAuthenticationProvider provider = AuthenticationProviderFactory.getAuthenticationProvider(authMethod, hiveConf); provider.Authenticate(userName, getPassword(request, authType)); } catch (Exception e) { throw new HttpAuthenticationException(e); } } return userName; }
/** * 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); } } }