Examples of AuthenticationToken


Examples of com.volantis.vdp.scs.authentication.AuthenticationToken

        if(packet.getRequestTypeIdetifier().equals(
                SCPPacket.AUTHENTICATION)) {

            AUPacket auPacket = new AUPacket(packet);

            AuthenticationToken token = this.auth.authenticate(
                    auPacket.getUserId(), auPacket.getPassword());

            if(token != null) {
                byte[] response =
                        String.valueOf(token.getStatus()).getBytes();
                packet.setDatablock(response);
                worker.send(packet.getBytes());

                if(token.getStatus() == AuthenticationToken.LOGIN_SUCCESFUL) {
                    SPSConnectionPool.setURLByConnection(
                                token.getUrl(),
                                connection
                            );
                    connection.setActive(true);

                    if(logger.isDebugEnabled()) {
View Full Code Here

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

        Job job = new Job(conf, "GDELTImport");

        String instanceName = accumuloGraphConfiguration.getAccumuloInstanceName();
        String zooKeepers = accumuloGraphConfiguration.getZookeeperServers();
        String principal = accumuloGraphConfiguration.getAccumuloUsername();
        AuthenticationToken authorizationToken = accumuloGraphConfiguration.getAuthenticationToken();
        AccumuloElementOutputFormat.setOutputInfo(job, instanceName, zooKeepers, principal, authorizationToken);

        job.setJarByClass(GDELTRunner.class);
        job.setMapperClass(GDELTMapper.class);
        job.setMapOutputValueClass(Mutation.class);
View Full Code Here

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

        Job job = new Job(conf, "friendsterImport");

        String instanceName = accumuloGraphConfiguration.getAccumuloInstanceName();
        String zooKeepers = accumuloGraphConfiguration.getZookeeperServers();
        String principal = accumuloGraphConfiguration.getAccumuloUsername();
        AuthenticationToken authorizationToken = accumuloGraphConfiguration.getAuthenticationToken();
        AccumuloElementOutputFormat.setOutputInfo(job, instanceName, zooKeepers, principal, authorizationToken);

        List<Text> splits = getSplits((AccumuloGraph) graph);
        Path splitFile = writeSplitsFile(conf, splits);
View Full Code Here

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

  }
 
  protected Scanner getScanner(StringBuilder sb) throws AccumuloException, AccumuloSecurityException {
    AccumuloConfiguration conf = Monitor.getSystemConfiguration();
    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();
      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());
      }
     
      AuthenticationToken token;
      try {
        token = AccumuloClassLoader.getClassLoader().loadClass(conf.get(Property.TRACE_TOKEN_TYPE)).asSubclass(AuthenticationToken.class).newInstance();
      } catch (Exception e) {
        throw new AccumuloException(e);
      }
     
      token.init(props);
      at = token;
    }
   
    String table = conf.get(Property.TRACE_TABLE);
    try {
View Full Code Here

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

    return connector;
  }
 
  public TCredentials getCredentials() {
    String username = getUserName();
    AuthenticationToken password = getToken();
    return CredentialHelper.createSquelchError(username, password, getInstance().getInstanceID());
  }
View Full Code Here

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

 
  public static AuthenticationToken extractToken(String tokenClass, byte[] token) throws AccumuloSecurityException {
    try {
      Object obj = Class.forName(tokenClass).newInstance();
      if (obj instanceof AuthenticationToken) {
        AuthenticationToken toRet = (AuthenticationToken) obj;
        toRet.readFields(new DataInputStream(new ByteArrayInputStream(token)));
        return toRet;
      }
    } catch (ClassNotFoundException cnfe) {
      log.error(cnfe, cnfe);
    } catch (InstantiationException e) {
View Full Code Here

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

  }
 
  @Override
  public ByteBuffer login(String principal, Map<String,String> loginProperties) throws org.apache.accumulo.proxy.thrift.AccumuloSecurityException, TException {
    try {
      AuthenticationToken token = getToken(principal, loginProperties);
      TCredentials credential = CredentialHelper.create(principal, token, instance.getInstanceID());
      ByteBuffer login = ByteBuffer.wrap(CredentialHelper.asByteArray(credential));
      getConnector(login); // check to make sure user exists
      return login;
    } catch (AccumuloSecurityException e) {
View Full Code Here

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

  }
 
  private AuthenticationToken getToken(String principal, Map<String,String> properties) throws AccumuloSecurityException, AccumuloException {
    AuthenticationToken.Properties props = new AuthenticationToken.Properties();
    props.putAllStrings(properties);
    AuthenticationToken token;
    try {
      token = tokenClass.newInstance();
    } catch (InstantiationException e) {
      throw new AccumuloException(e);
    } catch (IllegalAccessException e) {
      throw new AccumuloException(e);
    }
    token.init(props);
    return token;
  }
View Full Code Here

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

      String principal = split.getPrincipal();
      if (null == principal) {
        principal = getPrincipal(attempt);
      }

      AuthenticationToken token = split.getToken();
      if (null == token) {
        String tokenClass = getTokenClass(attempt);
        byte[] tokenBytes = getToken(attempt);
        try {
          token = CredentialHelper.extractToken(tokenClass, tokenBytes);
        } catch (AccumuloSecurityException e) {
          throw new IOException(e);
        }
      }

      Authorizations authorizations = split.getAuths();
      if (null == authorizations) {
        authorizations = getScanAuthorizations(attempt);
      }

      String table = split.getTable();
      if (null == table) {
        table = getInputTableName(attempt);
      }

      Boolean isOffline = split.isOffline();
      if (null == isOffline) {
        isOffline = isOfflineScan(attempt);
      }

      Boolean isIsolated = split.isIsolatedScan();
      if (null == isIsolated) {
        isIsolated = isIsolated(attempt);
      }

      Boolean usesLocalIterators = split.usesLocalIterators();
      if (null == usesLocalIterators) {
        usesLocalIterators = usesLocalIterators(attempt);
      }

      List<IteratorSetting> iterators = split.getIterators();
      if (null == iterators) {
        iterators = getIterators(attempt);
      }

      Set<Pair<Text,Text>> columns = split.getFetchedColumns();
      if (null == columns) {
        columns = getFetchedColumns(attempt);
      }

      try {
        log.debug("Creating connector with user: " + principal);
        Connector conn = instance.getConnector(principal, token);
        log.debug("Creating scanner for table: " + table);
        log.debug("Authorizations are: " + authorizations);
        if (isOffline) {
          String tokenClass = token.getClass().getCanonicalName();
          ByteBuffer tokenBuffer = ByteBuffer.wrap(CredentialHelper.toBytes(token));
          scanner = new OfflineScanner(instance, new TCredentials(principal, tokenClass, tokenBuffer, instance.getInstanceID()), Tables.getTableId(instance,
              table), authorizations);
        } else {
          scanner = conn.createScanner(table, authorizations);
View Full Code Here

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

      String principal = split.getPrincipal();
      if (null == principal) {
        principal = getPrincipal(job);
      }

      AuthenticationToken token = split.getToken();
      if (null == token) {
        String tokenClass = getTokenClass(job);
        byte[] tokenBytes = getToken(job);
        try {
          token = CredentialHelper.extractToken(tokenClass, tokenBytes);
        } catch (AccumuloSecurityException e) {
          throw new IOException(e);
        }
      }

      Authorizations authorizations = split.getAuths();
      if (null == authorizations) {
        authorizations = getScanAuthorizations(job);
      }

      String table = split.getTable();
      if (null == table) {
        table = getInputTableName(job);
      }

      Boolean isOffline = split.isOffline();
      if (null == isOffline) {
        isOffline = isOfflineScan(job);
      }

      Boolean isIsolated = split.isIsolatedScan();
      if (null == isIsolated) {
        isIsolated = isIsolated(job);
      }

      Boolean usesLocalIterators = split.usesLocalIterators();
      if (null == usesLocalIterators) {
        usesLocalIterators = usesLocalIterators(job);
      }

      List<IteratorSetting> iterators = split.getIterators();
      if (null == iterators) {
        iterators = getIterators(job);
      }

      Set<Pair<Text,Text>> columns = split.getFetchedColumns();
      if (null == columns) {
        columns = getFetchedColumns(job);
      }

      try {
        log.debug("Creating connector with user: " + principal);
        Connector conn = instance.getConnector(principal, token);
        log.debug("Creating scanner for table: " + table);
        log.debug("Authorizations are: " + authorizations);
        if (isOffline) {
          String tokenClass = token.getClass().getCanonicalName();
          ByteBuffer tokenBuffer = ByteBuffer.wrap(CredentialHelper.toBytes(token));
          scanner = new OfflineScanner(instance, new TCredentials(principal, tokenClass, tokenBuffer, instance.getInstanceID()), Tables.getTableId(instance,
              table), authorizations);
        } else {
          scanner = conn.createScanner(table, authorizations);
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.