This library lets you easily generate authentication tokens for accessing your Firebase securely. Depends on PHP-JWT.
<?php
include_once "FirebaseToken.php";
$secret = "0014ae3b1ded44de9d9f6fc60dfd1c64";
$tokenGen = new Services_FirebaseTokenGenerator($secret);
$token = $tokenGen->createToken(array("id" => "example"));
// Get data only readable by auth.id = "example".
$uri = "https://example.firebaseio.com/.json?auth=".$token;
var_dump(file_get_contents($uri));
?>
MIT.