@Override public void checkOutputSpecs(JobContext job) throws IOException { if (!isConnectorInfoSet(job)) throw new IOException("Connector info has not been set."); String principal = getPrincipal(job); AuthenticationToken token = getAuthenticationToken(job); try { AccumuloClient c = OutputConfigurator.client(CLASS, job.getConfiguration()); if (!c.securityOperations().authenticateUser(principal, token)) throw new IOException("Unable to authenticate user"); } catch (AccumuloException | AccumuloSecurityException e) { throw new IOException(e); } }
@Override public void checkOutputSpecs(FileSystem ignored, JobConf job) throws IOException { if (!isConnectorInfoSet(job)) throw new IOException("Connector info has not been set."); try { AccumuloClient c = OutputConfigurator.client(CLASS, job); String principal = getPrincipal(job); AuthenticationToken token = getAuthenticationToken(job); if (!c.securityOperations().authenticateUser(principal, token)) throw new IOException("Unable to authenticate user"); } catch (AccumuloException | AccumuloSecurityException e) { throw new IOException(e); } }
@Override public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws AccumuloException, AccumuloSecurityException, IOException { final String user = cl.getArgs()[0]; final String p = shellState.readMaskedLine("Enter current password for '" + user + "': ", '*'); if (p == null) { shellState.getReader().println(); return 0; } // user canceled final byte[] password = p.getBytes(UTF_8); final boolean valid = shellState.getAccumuloClient().securityOperations().authenticateUser(user, new PasswordToken(password)); shellState.getReader().println((valid ? "V" : "Not v") + "alid"); return 0; }
public void updateUser(String principal, AuthenticationToken token) throws AccumuloException, AccumuloSecurityException { if (accumuloClient != null) { accumuloClient.close(); } accumuloClient = Accumulo.newClient().from(clientProperties).as(principal, token).build(); accumuloClient.securityOperations().authenticateUser(principal, token); context = (ClientContext) accumuloClient; }
if (!shellState.getAccumuloClient().securityOperations().authenticateUser(currentUser, new PasswordToken(oldPassword))) throw new AccumuloSecurityException(user, SecurityErrorCode.BAD_CREDENTIALS);
.authenticateUser(accumuloClient.whoami(), new PasswordToken(pwd)); } catch (Exception e) { ++exitCode;
@Override public void checkOutputSpecs(JobContext job) throws IOException { if (!isConnectorInfoSet(job)) throw new IOException("Connector info has not been set."); try { // if the instance isn't configured, it will complain here String principal = getPrincipal(job); AuthenticationToken token = getAuthenticationToken(job); Connector c = getInstance(job).getConnector(principal, token); if (!c.securityOperations().authenticateUser(principal, token)) throw new IOException("Unable to authenticate user"); } catch (AccumuloException e) { throw new IOException(e); } catch (AccumuloSecurityException e) { throw new IOException(e); } }
@Override public void checkOutputSpecs(FileSystem ignored, JobConf job) throws IOException { if (!isConnectorInfoSet(job)) throw new IOException("Connector info has not been set."); try { // if the instance isn't configured, it will complain here String principal = getPrincipal(job); AuthenticationToken token = getAuthenticationToken(job); Connector c = getInstance(job).getConnector(principal, token); if (!c.securityOperations().authenticateUser(principal, token)) throw new IOException("Unable to authenticate user"); } catch (AccumuloException e) { throw new IOException(e); } catch (AccumuloSecurityException e) { throw new IOException(e); } }
@Override public void checkOutputSpecs(JobContext job) throws IOException { Properties clientProps = OutputConfigurator.getClientProperties(CLASS, job.getConfiguration()); AuthenticationToken token = ClientProperty.getAuthenticationToken(clientProps); try (AccumuloClient c = Accumulo.newClient().from(clientProps).build()) { if (!c.securityOperations().authenticateUser(c.whoami(), token)) throw new IOException("Unable to authenticate user"); } catch (AccumuloException | AccumuloSecurityException e) { throw new IOException(e); } }
@Override public void checkOutputSpecs(FileSystem ignored, JobConf job) throws IOException { Properties clientProps = OutputConfigurator.getClientProperties(CLASS, job); AuthenticationToken token = ClientProperty.getAuthenticationToken(clientProps); try (AccumuloClient c = Accumulo.newClient().from(clientProps).build()) { if (!c.securityOperations().authenticateUser(c.whoami(), token)) throw new IOException("Unable to authenticate user"); } catch (AccumuloException | AccumuloSecurityException e) { throw new IOException(e); } }
@Override public boolean authenticateUser(ByteBuffer login, String user, Map<String,String> properties) throws org.apache.accumulo.proxy.thrift.AccumuloException, org.apache.accumulo.proxy.thrift.AccumuloSecurityException, TException { try { return getConnector(login).securityOperations().authenticateUser(user, getToken(user, properties)); } catch (Exception e) { handleException(e); return false; } }
@Override public void checkOutputSpecs(JobContext job) throws IOException { if (!isConnectorInfoSet(job)) throw new IOException("Connector info has not been set."); try { // if the instance isn't configured, it will complain here String principal = getPrincipal(job); AuthenticationToken token = getAuthenticationToken(job); AccumuloClient c = Accumulo.newClient().usingClientInfo(getClientInfo(job)).build(); if (!c.securityOperations().authenticateUser(principal, token)) throw new IOException("Unable to authenticate user"); } catch (AccumuloException | AccumuloSecurityException e) { throw new IOException(e); } }
@Override public void checkOutputSpecs(FileSystem ignored, JobConf job) throws IOException { if (!isConnectorInfoSet(job)) throw new IOException("Connector info has not been set."); try { // if the instance isn't configured, it will complain here AccumuloClient c = Accumulo.newClient().usingClientInfo(getClientInfo(job)).build(); String principal = getPrincipal(job); AuthenticationToken token = getAuthenticationToken(job); if (!c.securityOperations().authenticateUser(principal, token)) throw new IOException("Unable to authenticate user"); } catch (AccumuloException | AccumuloSecurityException e) { throw new IOException(e); } }
/** * Check authenticationToken works for this user. */ private void checkCredentials() { try { if (!connector.securityOperations().authenticateUser(connector.whoami(), authenticationToken)) throw new IllegalArgumentException("instance " + connector.getInstance().getInstanceName() + ": bad username " + connector.whoami() + " with token " + authenticationToken); } catch (AccumuloException | AccumuloSecurityException e) { throw new IllegalArgumentException("instance " + connector.getInstance().getInstanceName() + ": error with username " + connector.whoami() + " with token " + authenticationToken, e); } }
@Override public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws AccumuloException, AccumuloSecurityException, IOException { final String user = cl.getArgs()[0]; final String p = shellState.readMaskedLine("Enter current password for '" + user + "': ", '*'); if (p == null) { shellState.getReader().println(); return 0; } // user canceled final byte[] password = p.getBytes(UTF_8); final boolean valid = shellState.getConnector().securityOperations().authenticateUser(user, new PasswordToken(password)); shellState.getReader().println((valid ? "V" : "Not v") + "alid"); return 0; }
AuthenticationToken token = getAuthenticationToken(implementingClass, conf); Connector c = getInstance(implementingClass, conf).getConnector(principal, token); if (!c.securityOperations().authenticateUser(principal, token)) throw new IOException("Unable to authenticate user");
if (!c.securityOperations().authenticateUser(getUsername(conf), new PasswordToken(getPassword(conf)))) throw new IOException("Unable to authenticate user"); if (!c.securityOperations().hasTablePermission(getUsername(conf), getTablename(conf), TablePermission.READ))
if (!shellState.getConnector().securityOperations().authenticateUser(currentUser, new PasswordToken(oldPassword))) throw new AccumuloSecurityException(user, SecurityErrorCode.BAD_CREDENTIALS);
authFailed = !connector.securityOperations().authenticateUser(connector.whoami(), new PasswordToken(pwd)); } catch (Exception e) {
result = conn.securityOperations().authenticateUser(target, new PasswordToken(password)); } catch (AccumuloSecurityException ae) { switch (ae.getSecurityErrorCode()) {