@InterfaceAudience.Private
  public static CompletableFuture<Token<AuthenticationTokenIdentifier>>
    obtainToken(AsyncConnection conn) {
    CompletableFuture<Token<AuthenticationTokenIdentifier>> future = new CompletableFuture<>();
    if (injectedException != null) {
      future.completeExceptionally(ProtobufUtil.handleRemoteException(injectedException));
      return future;
    }
    AsyncTable<?> table = conn.getTable(TableName.META_TABLE_NAME);
    table.<AuthenticationProtos.AuthenticationService.Interface,
      AuthenticationProtos.GetAuthenticationTokenResponse> coprocessorService(
        AuthenticationProtos.AuthenticationService::newStub,
        (s, c, r) -> s.getAuthenticationToken(c,
          AuthenticationProtos.GetAuthenticationTokenRequest.getDefaultInstance(), r),
        HConstants.EMPTY_START_ROW)
      .whenComplete((resp, error) -> {
        if (error != null) {
          future.completeExceptionally(ProtobufUtil.handleRemoteException(error));
        } else {
          future.complete(toToken(resp.getToken()));
        }
      });
    return future;
  }
Obtain and return an authentication token for the current user.
@param conn The async HBase cluster connection
@return the authentication token instance, wrapped by a {@link CompletableFuture}.
hbase-client/src/main/java/org/apache/hadoop/hbase/security/token/ClientTokenUtil.java