Download the PHP package firebase/php-jwt without Composer

On this page you can find all versions of the php package firebase/php-jwt. 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?
firebase/php-jwt
Rate from 1 - 5
Rated 4.44 based on 32 reviews

All versions of php-jwt with dependencies

Informations about the package php-jwt

Build Status Latest Stable Version Total Downloads License

PHP-JWT

A simple library to encode and decode JSON Web Tokens (JWT) in PHP, conforming to RFC 7519.

Installation

Use composer to manage your dependencies and download PHP-JWT:

Optionally, install the paragonie/sodium_compat package from composer if your php is < 7.2 or does not have libsodium installed:

Example

Example with RS256 (openssl)

Example with a passphrase

Example with EdDSA (libsodium and Ed25519 signature)

`

Using JWKs

Using Cached Key Sets

The CachedKeySet class can be used to fetch and cache JWKS (JSON Web Key Sets) from a public URI. This has the following advantages:

  1. The results are cached for performance.
  2. If an unrecognized key is requested, the cache is refreshed, to accomodate for key rotation.
  3. If rate limiting is enabled, the JWKS URI will not make more than 10 requests a second.

Miscellaneous

Casting to array

The return value of JWT::decode is the generic PHP object stdClass. If you'd like to handle with arrays instead, you can do the following:

Changelog

6.3.0 / 2022-07-15

6.2.0 / 2022-05-14

6.1.0 / 2022-03-23

6.0.0 / 2022-01-24

5.0.0 / 2017-06-26

4.0.0 / 2016-07-17

3.0.0 / 2015-07-22

2.2.0 / 2015-06-22

2.1.0 / 2015-05-20

2.0.0 / 2015-04-01

Tests

Run the tests using phpunit:

New Lines in private keys

If your private key contains \n characters, be sure to wrap it in double quotes "" and not single quotes '' in order to properly interpret the escaped characters.

License

3-Clause BSD.


Version
Requires php Version ^7.1||^8.0

The package firebase/php-jwt contains the following files

Loading the files please wait ....