Download the PHP package kylesean/hyperf-jwt without Composer

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

Hyperf JWT Package

English | 中文文档

A high-performance, lightweight JWT (JSON Web Token) package designed for Hyperf coroutine framework, powered by lcobucci/jwt v5.


Features


Installation

Install via Composer:

Publish the configuration file:

Generate a secure secret key:


Quick Start

1. Token Issuance & Parsing


2. Token Refreshing

The ManagerInterface::refreshToken() method allows clients to swap an expiring token for a fresh token within the configured refresh window (refresh_ttl), automatically blacklisting the old token.


3. Token Invalidation & Blacklist Grace Period

Manual Invalidation (Logout)

The blacklist entry for an invalidated token is kept until the token's natural expiry plus the full refresh_ttl window, so a logged-out token can never be "revived" by refreshing it later. Pass true as the second argument to keep the entry for one year ("forever") instead: $manager->invalidate($token, true).

Coroutine Concurrency Grace Period

In high-concurrency coroutine environments (e.g. 5 parallel HTTP requests sent by a Single Page App simultaneously), if one request refreshes the token and invalidates the old one immediately, the remaining 4 concurrent requests carrying the old token might trigger 401 Unauthorized errors.

Configure the concurrency grace period in config/autoload/jwt.php:

During this 30-second window, the replaced old token remains accepted as valid, preventing race-condition failures.

Concurrency semantics: the grace period guarantees that concurrent requests validating the old token do not fail. Blacklisting itself is a non-atomic check-then-set against the cache, so two refresh calls arriving at the exact same instant may both succeed and each receive a new token (the old token still ends up blacklisted). If your business logic requires strictly single-use refresh, add a distributed lock around refreshToken().


4. Authentication Middleware

Register JwtAuthMiddleware in your routes or controller annotations:

Access authenticated identity inside controllers:


License

MIT license


All versions of hyperf-jwt with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
lcobucci/jwt Version ^5.4
psr/clock Version ^1.0
hyperf/contract Version ^3.0 || ^3.1
hyperf/cache Version ^3.0 || ^3.1
hyperf/stringable Version ^3.0 || ^3.1
psr/simple-cache Version ^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 kylesean/hyperf-jwt contains the following files

Loading the files please wait ...