Download the PHP package / without Composer

On this page you can find all versions of the php package /. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?
/
Rate from 1 - 5
Rated 5.00 based on 2 reviews

Informations about the package

Firebase Tokens

A library to work with Google Firebase tokens. You can use it to create custom tokens and verify ID Tokens.

Achieve more with the Firebase Admin SDK for PHP (which uses this library).

Current version [Supported PHP version]() Monthly Downloads Total Downloads Tests Sponsor


The future of the Firebase Admin PHP SDK

Please read about the future of the Firebase Admin PHP SDK on the SDK's GitHub Repository.


Installation

Simple usage

Create a custom token

More information on what a custom token is and how it can be used can be found in Google's official documentation.

Verify an ID token

The ID token verification methods included in the Firebase Admin SDKs are meant to verify ID tokens that come from the client SDKs, not the custom tokens that you create with the Admin SDKs. See Auth tokens for more information.

Verify a Session Cookie

Session cookie verification is similar to ID Token verification.

See Manage Session Cookies for more information.

Tokens

Tokens returned from the Generator and Verifier are instances of \Kreait\Firebase\JWT\Contract\Token and represent a JWT. The displayed outputs are examples and vary depending on the information associated with the given user in your project's auth database.

According to the JWT specification, you can expect the following payload fields to be always available: iss, aud, auth_time, sub, iat, exp. Other fields depend on the authentication method of the given account and the information stored in your project's Auth database.

Tenant Awareness

You can create custom tokens that are scoped to a given tenant:

Similarly, you can verify that ID tokens were issued in the scope of a given tenant:

Session cookies currently don't support tenants.

Advanced usage

Cache results from the Google Secure Token Store

In order to verify ID tokens, the verifier makes a call to fetch Firebase's currently available public keys. The keys are cached in memory by default.

If you want to cache the public keys more effectively, you can initialize the verifier with an implementation of psr/simple-cache or psr/cache to reduce the amount of HTTP requests to Google's servers.

Here's an example using the Symfony Cache Component:

Supported Versions

Only the latest version is actively supported.

Earlier versions will receive security fixes as long as their lowest PHP requirement receives security fixes. For example, when a version supports PHP 7.4 and PHP 8.0, security support will end when security support for PHP 7.4 ends.

Version Initial Release Supported PHP Versions Status
5.x 25 Nov 2023 ~8.1.0, ~8.2.0, ~8.3.0 Active
4.x 26 Nov 2022 ~8.1.0, ~8.2.0 Security Support
3.x 25 Apr 2022 ^7.4, ^8.0 End of life
2.x 03 Jan 2022 ^7.4, ^8.0 End of life
1.x 06 Feb 2017 >=5.5 End of life

License

The MIT License (MIT). Please see License File for more information.


All versions of with dependencies

PHP Build Version
Package Version
Requires php Version ~8.1.0 || ~8.2.0 || ~8.3.0
ext-json Version *
ext-openssl Version *
beste/clock Version ^3.0
fig/http-message-util Version ^1.1.5
guzzlehttp/guzzle Version ^7.5
lcobucci/clock Version ^3.0
lcobucci/jwt Version ^4.3.0|^5.0
psr/cache Version ^1.0|^2.0|^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package / contains the following files

Loading the files please wait ....