Download the PHP package zenstruck/jwt without Composer

On this page you can find all versions of the php package zenstruck/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?

Informations about the package jwt

zenstruck/jwt

Build Status Scrutinizer Code Quality Code Coverage SensioLabs Insight StyleCI Latest Stable Version License

Provides a lightweight implementation of the JWS (JSON Web Signature) specification. This library is a fork of namshi/jose.

Requirements

  1. PHP 5.4.8+ (tested on 5.4, 5.5, 5.6, 7 and HHVM)
  2. (Optional) OpenSSL extension (when using RSA/ECDSA signers)
  3. (Optional) symfony/polyfill-php56 library (when HMAC signers in PHP versions less than 5.6)

Installation

composer require zenstruck/jwt

When using an HMAC signer in PHP versions less than 5.6

composer require symfony/polyfill-php56

Basic Usage

  1. Create, encode and send a token to the user:

  2. Fetch encoded token from user, decode, verify, validate and access custom claims

Token Builder

Signers

HMAC

These signers require an identical key string to be used for signing and validating.

Algorithm Signer Class
HS256 Zenstruck\JWT\Signer\HMAC\HS256
HS384 Zenstruck\JWT\Signer\HMAC\HS384
HS512 Zenstruck\JWT\Signer\HMAC\HS512

Usage

RSA/ECDSA (OpenSSL)

These signers require a private key for signing and a public key for verifying.

Algorithm Signer Class
RS256 Zenstruck\JWT\Signer\OpenSSL\RSA\RS256
RS384 Zenstruck\JWT\Signer\OpenSSL\RSA\RS384
RS512 Zenstruck\JWT\Signer\OpenSSL\RSA\RS512
ES256 Zenstruck\JWT\Signer\OpenSSL\ECDSA\ES256
ES384 Zenstruck\JWT\Signer\OpenSSL\ECDSA\ES384
ES512 Zenstruck\JWT\Signer\OpenSSL\ECDSA\ES512

Usage

Keychain

A keychain contains both a public and private key. When passed a keychain as the key, the signer uses the proper key for the operation.

Validation

Validator Description
Zenstruck\JWT\Validator\IssuerValidator Ensures iss claim exists and matches expected value
Zenstruck\JWT\Validator\SubjectValidator Ensures sub claim exists and matches expected value
Zenstruck\JWT\Validator\AudienceValidator Ensures aud claim exists and matches expected value
Zenstruck\JWT\Validator\ExpiresAtValidator Ensures exp claim exists is not greater than expected time
Zenstruck\JWT\Validator\NotBeforeValidator Ensures nbf claim exists is not less than expected time
Zenstruck\JWT\Validator\IssuedAtValidator Ensures iat claim exists and matches expected value
Zenstruck\JWT\Validator\IdAtValidator Ensures jti claim exists and matches expected value
Zenstruck\JWT\Validator\ChainValidator Combines any of the above validators together

Usage

ValidatorBuilder


All versions of jwt with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.8
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 zenstruck/jwt contains the following files

Loading the files please wait ....