public void verifyToken(byte[] tokenBytes) throws IOException {
    if (!UserGroupInformation.isSecurityEnabled()) return;
    if (tokenBytes == null) throw new SecurityException("Token required for authentication");
    Token<LlapTokenIdentifier> token = new Token<>();
    token.readFields(new DataInputStream(new ByteArrayInputStream(tokenBytes)));
    verifyToken(token.decodeIdentifier(), token.getPassword());
  }
Verifies the token available as serialized bytes.
llap-common/src/java/org/apache/hadoop/hive/llap/security/SecretManager.java