@Override
  protected byte[] createPassword(DelegationTokenIdentifier id) {
    byte[] password;
    DelegationTokenInformation info;
    synchronized (this) {
      password = super.createPassword(id);
      // add new token to shared store
      // need to persist expiration along with password
      info = super.currentTokens.remove(id);
      if (info == null) {
        throw new IllegalStateException("Failed to retrieve token after creation");
      }
    }
    this.tokenStore.addToken(id, info);
    return password;
  }
Create the password and add it to shared store.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/security/TokenStoreDelegationTokenSecretManager.java