Download the PHP package bayfrontmedia/php-jwt without Composer

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

Informations about the package php-jwt

PHP-JWT

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

Currently, the only supported algorithm is "HS256". Support for additional algorithms is planned for future versions.

License

This project is open source and available under the MIT License.

Author

Bayfront Media

Requirements

Installation

Usage

A private, reproducible secret must be passed to the constructor. The same secret used to encode the JWT must also be used when decoding in order to verify the signature.

A cryptographically secure secret can be generated using the static createSecret() method, if needed.

Public methods


createSecret

Description:

Create a cryptographically secure secret of random bytes.

NOTE: Secrets are meant to be stored, as the same secret used to encode a JWT must be used to decode it.

Parameters:

Returns:

Throws:

Example:


getHeader

Description:

Returns current header array.

Parameters:

Returns:

Example:


setHeader

Description:

Set custom value(s) to the current header array.

Parameters:

Returns:

Example:


removeHeader

Description:

Remove header key, if existing.

Parameters:

Returns:

Example:


getPayload

Description:

Returns current payload array.

Parameters:

Returns:

Example:


setPayload

Description:

Set custom value(s) to the current payload array.

Parameters:

Returns:

Example:


removePayload

Description:

Remove payload key, if existing.

Parameters:

Returns:

Example:


aud

Description:

Set audience.

Parameters:

Returns:


exp

Description:

Set expiration time.

Parameters:

Returns:


iat

Description:

Set issued at time.

Parameters:

Returns:


iss

Description:

Set issuer.

Parameters:

Returns:


jti

Description:

Set JWT ID.

Parameters:

Returns:


nbf

Description:

Set not before time.

Parameters:

Returns:


sub

Description:

Set subject.

Parameters:

Returns:


encode

Description:

Encode and return a signed JWT.

Parameters:

Returns:

Example:


decode

Description:

Decode a JWT.

This method validates the token structure as three segments separated by dots.

The returned array will contain the keys header, payload and signature.

If $validate = true, the signature and claims will also be validated.

Parameters:

Returns:

Throws:

Example:


validateSignature

Description:

Validate signature.

Parameters:

Returns:

Throws:

Example:


validateClaims

Description:

Validate the claims "iat", "nbf" and "exp", if existing.

Parameters:

Returns:

Throws:

Example:



All versions of php-jwt with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
ext-json Version *
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 bayfrontmedia/php-jwt contains the following files

Loading the files please wait ....