public synchronized String verifyDelegationToken(String tokenStrForm) throws IOException {
    Token<DelegationTokenIdentifier> t = new Token<>();
    t.decodeFromUrlString(tokenStrForm);

    DelegationTokenIdentifier id = getTokenIdentifier(t);
    verifyToken(id, t.getPassword());
    return id.getUser().getShortUserName();
  }
Verify token string
@param tokenStrForm
@return user name
@throws IOException
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/security/DelegationTokenSecretManager.java