at the moment it's not implemented into pm itself but it's due to be implemented very soon. Either wait for pmmp to implement or look at how the old genisys did it for example (You'll need OpenSSLm, but all new php bins built with php-build-scripts should contain it.
PHP: public function onPacketReceived(DataPacketReceiveEvent $event){ $packet = $event->getPacket(); if($packet instanceof LoginPacket){ if(!isset($packet->chainData["chain"][2])){ //do stuff } }} thanks @Muqsit for that code
not infallible? it's worse than useless if you ask me... what happens if an MCPE update adds extra links to the chain? The correct way to do this is verify the signature of the JWTs. The following things should be checked: a) the first link is self-signed b) the second link is signed with the Mojang root public key c) every link after that is signed with the identityPublicKey of the previous link. I was intending to implement this today, but the crypto library I want to use is currently not compatible with PHP 7.2.