Package org.apache.hadoop.yarn.security.client

Examples of org.apache.hadoop.yarn.security.client.ClientTokenIdentifier


      this.rmContext.getClientToAMTokenSecretManager().registerApplication(
        appAttemptId);

      Token<ClientTokenIdentifier> token =
          new Token<ClientTokenIdentifier>(new ClientTokenIdentifier(
            appAttemptId), this.rmContext.getClientToAMTokenSecretManager());
      this.clientToken =
          BuilderUtils.newClientToken(token.getIdentifier(), token.getKind()
            .toString(), token.getPassword(), token.getService().toString());
    }
View Full Code Here


      secretManager = new ClientToAMSecretManager();
      String secretKeyStr =
          System
              .getenv(ApplicationConstants.APPLICATION_CLIENT_SECRET_ENV_NAME);
      byte[] bytes = Base64.decodeBase64(secretKeyStr);
      ClientTokenIdentifier identifier = new ClientTokenIdentifier(
          this.appContext.getApplicationID());
      secretManager.setMasterKey(identifier, bytes);
    }
    server =
        rpc.getServer(MRClientProtocol.class, protocolHandler, address,
View Full Code Here

      this.rmContext.getClientToAMTokenSecretManager().registerApplication(
        appAttemptId);

      Token<ClientTokenIdentifier> token =
          new Token<ClientTokenIdentifier>(new ClientTokenIdentifier(
            appAttemptId), this.rmContext.getClientToAMTokenSecretManager());
      this.clientToken =
          BuilderUtils.newClientToken(token.getIdentifier(), token.getKind()
            .toString(), token.getPassword(), token.getService().toString());
    }
View Full Code Here

      DataOutputBuffer dob = new DataOutputBuffer();
      credentials.writeTokenStorageToStream(dob);
      container.setContainerTokens(
          ByteBuffer.wrap(dob.getData(), 0, dob.getLength()));

      ClientTokenIdentifier identifier = new ClientTokenIdentifier(
          application.getAppAttemptId().getApplicationId());
      SecretKey clientSecretKey =
          this.clientToAMSecretManager.getMasterKey(identifier);
      String encoded =
          Base64.encodeBase64URLSafeString(clientSecretKey.getEncoded());
View Full Code Here

      String clientTokenStr = null;
      String user = UserGroupInformation.getCurrentUser().getShortUserName();
      if (UserGroupInformation.isSecurityEnabled()) {
        Token<ClientTokenIdentifier> clientToken = new
            Token<ClientTokenIdentifier>(
            new ClientTokenIdentifier(applicationId),
            this.clientToAMSecretManager);
        clientTokenStr = clientToken.encodeToUrlString();
        LOG.debug("Sending client token as " + clientTokenStr);
      }
     
View Full Code Here

  public String getClientToken() {
    String tokenStr = null;
    if (UserGroupInformation.isSecurityEnabled()) {
      try {
        UserGroupInformation ugi = UserGroupInformation.getCurrentUser();
        ClientTokenIdentifier tokenId =
            new ClientTokenIdentifier(applicationAttemptId.getApplicationId(),
                ugi.getUserName());
        Token<ClientTokenIdentifier> token =
            new Token<ClientTokenIdentifier>(tokenId,
                this.rmContext.getClientToAMSecretManager());
        tokenStr = token.encodeToUrlString();
View Full Code Here

TOP

Related Classes of org.apache.hadoop.yarn.security.client.ClientTokenIdentifier

Copyright © 2018 www.massapicom. 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.