Skip to content

exocom/firebase-token-generator-php

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Firebase Token Generator for PHP

This library lets you easily generate authentication tokens for accessing your Firebase securely. Depends on PHP-JWT.

Example

<?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));
?>

License

MIT.

About

Firebase Token Generator for PHP

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%