Examples of AuthenticationToken


Examples of org.apache.accumulo.core.client.security.tokens.AuthenticationToken

    Authorizations auths = getScanAuthorizations(context);
    String principal = getPrincipal(context);
    String tokenClass = getTokenClass(context);
    byte[] tokenBytes = getToken(context);

    AuthenticationToken token;
    try {
      token = CredentialHelper.extractToken(tokenClass, tokenBytes);
    } catch (AccumuloSecurityException e) {
      throw new IOException(e);
    }
View Full Code Here

Examples of org.apache.accumulo.core.client.security.tokens.AuthenticationToken

    Authorizations auths = getScanAuthorizations(job);
    String principal = getPrincipal(job);
    String tokenClass = getTokenClass(job);
    byte[] tokenBytes = getToken(job);

    AuthenticationToken token;
    try {
      token = CredentialHelper.extractToken(tokenClass, tokenBytes);
    } catch (AccumuloSecurityException e) {
      throw new IOException(e);
    }
View Full Code Here

Examples of org.apache.accumulo.core.client.security.tokens.AuthenticationToken

      Properties props = new Properties();
      for (Entry<String,String> loginOption : loginProps.entrySet())
        props.put(loginOption.getKey(), loginOption.getValue());
     
      try {
        AuthenticationToken token = Class.forName(tokenClassName).asSubclass(AuthenticationToken.class).newInstance();
        token.init(props);
        return token;
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
View Full Code Here

Examples of org.apache.accumulo.core.client.security.tokens.AuthenticationToken

  @Override
  public void run() throws Exception {
   
    FileSystem fs = FileSystem.get(CachedConfiguration.getInstance());
    fs.delete(new Path("tmp/testmf"), true);
    AuthenticationToken token = this.getToken();
    CreateRFiles.main(new String[] {"--output", "tmp/testmf", "--numThreads", "8", "--start", "0", "--end", "100000", "--splits", "99"});
   
    bulkImport(fs, TABLE_NAME, "tmp/testmf");
   
    checkSplits(TABLE_NAME, 0, 0);
View Full Code Here

Examples of org.apache.accumulo.core.client.security.tokens.AuthenticationToken

    table = conf.get(Property.TRACE_TABLE);
    Connector connector = null;
    while (true) {
      try {
        String principal = conf.get(Property.TRACE_USER);
        AuthenticationToken at;
        Map<String,String> loginMap = conf.getAllPropertiesWithPrefix(Property.TRACE_TOKEN_PROPERTY_PREFIX);
        if (loginMap.isEmpty()) {
          Property p = Property.TRACE_PASSWORD;
          at = new PasswordToken(conf.get(p).getBytes(Constants.UTF8));
        } else {
          Properties props = new Properties();
          AuthenticationToken token = AccumuloClassLoader.getClassLoader().loadClass(conf.get(Property.TRACE_TOKEN_TYPE)).asSubclass(AuthenticationToken.class)
              .newInstance();

          int prefixLength = Property.TRACE_TOKEN_PROPERTY_PREFIX.getKey().length() + 1;
          for (Entry<String,String> entry : loginMap.entrySet()) {
            props.put(entry.getKey().substring(prefixLength), entry.getValue());
          }

          token.init(props);
         
          at = token;
        }
       
        connector = serverConfiguration.getInstance().getConnector(principal, at);
View Full Code Here

Examples of org.apache.accumulo.core.client.security.tokens.AuthenticationToken

    else if (credentials.getPrincipal().equals(SecurityConstants.SYSTEM_PRINCIPAL)) {
      throw new ThriftSecurityException(credentials.getPrincipal(), SecurityErrorCode.BAD_CREDENTIALS);
    }

    try {
      AuthenticationToken token = reassembleToken(credentials);
      if (!authenticator.authenticateUser(credentials.getPrincipal(), token)) {
        throw new ThriftSecurityException(credentials.getPrincipal(), SecurityErrorCode.BAD_CREDENTIALS);
      }
    } catch (AccumuloSecurityException e) {
      log.debug(e);
View Full Code Here

Examples of org.apache.accumulo.core.client.security.tokens.AuthenticationToken

    canAskAboutUser(credentials, toAuth.getPrincipal());
    // User is already authenticated from canAskAboutUser, this gets around issues with !SYSTEM user
    if (credentials.equals(toAuth))
      return true;
    try {
      AuthenticationToken token = reassembleToken(toAuth);
      return authenticator.authenticateUser(toAuth.getPrincipal(), token);
    } catch (AccumuloSecurityException e) {
      throw e.asThriftException();
    }
  }
View Full Code Here

Examples of org.apache.accumulo.core.client.security.tokens.AuthenticationToken

  public void changePassword(TCredentials credentials, TCredentials toChange) throws ThriftSecurityException {
    if (!canChangePassword(credentials, toChange.getPrincipal()))
      throw new ThriftSecurityException(credentials.getPrincipal(), SecurityErrorCode.PERMISSION_DENIED);
    try {
      AuthenticationToken token = reassembleToken(toChange);
      authenticator.changePassword(toChange.getPrincipal(), token);
      log.info("Changed password for user " + toChange.getPrincipal() + " at the request of user " + credentials.getPrincipal());
    } catch (AccumuloSecurityException e) {
      throw e.asThriftException();
    }
View Full Code Here

Examples of org.apache.accumulo.core.client.security.tokens.AuthenticationToken

  public void createUser(TCredentials credentials, TCredentials newUser, Authorizations authorizations) throws ThriftSecurityException {
    if (!canCreateUser(credentials, newUser.getPrincipal()))
      throw new ThriftSecurityException(credentials.getPrincipal(), SecurityErrorCode.PERMISSION_DENIED);
    try {
      AuthenticationToken token = reassembleToken(newUser);
      authenticator.createUser(newUser.getPrincipal(), token);
      authorizor.initUser(newUser.getPrincipal());
      permHandle.initUser(newUser.getPrincipal());
      log.info("Created user " + newUser.getPrincipal() + " at the request of user " + credentials.getPrincipal());
      if (canChangeAuthorizations(credentials, newUser.getPrincipal()))
View Full Code Here

Examples of org.apache.accumulo.core.client.security.tokens.AuthenticationToken

  @Override
  public void run() throws Exception {
   
    FileSystem fs = FileSystem.get(CachedConfiguration.getInstance());
    fs.delete(new Path("/tmp/testmf"), true);
    AuthenticationToken token = this.getToken();
    CreateRFiles.main(new String[] {"--output", "tmp/testmf", "--numThreads", "8", "--start", "0", "--end", "100000", "--splits", "99"});
   
    bulkImport(fs, TABLE_NAME, "/tmp/testmf");
   
    checkSplits(TABLE_NAME, 0, 0);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.