PHPackages                             igor/php-jwt-manager - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. igor/php-jwt-manager

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

igor/php-jwt-manager
====================

A class to decode, verify and generate tokens with the php-jwt library

0.1.3(9y ago)022MITPHP

Since Feb 21Pushed 9y ago1 watchersCompare

[ Source](https://github.com/Igor-Lopes/php-jwt-manager)[ Packagist](https://packagist.org/packages/igor/php-jwt-manager)[ RSS](/packages/igor-php-jwt-manager/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (4)Dependencies (1)Versions (5)Used By (0)

php-jwt-manager
===============

[](#php-jwt-manager)

A class to decode, verify and generate tokens with the php-jwt library.

Quick Intro to JSON Web Tokens:
-------------------------------

[](#quick-intro-to-json-web-tokens)

JSON Web Tokens are an easy way to authenticate an API. Unlikely in the traditional Server Session Authentication, the session data is stored only in the client side, reducing database queries, improving the backend performance and scalability.

### Some Advantages of JWT:

[](#some-advantages-of-jwt)

- JSON Web Tokens can be used in different languages: JWT libraries are available for several languages;
- Practical : JSON Web Tokens are easy to pass in HTTP headers or through URLs;
- Better Performance and Scalability: Since JSON Web Tokens are stateless, they reduce database queries and improve backend performance, as well, make it possible to have a distributed or clustered infrastructure that share the same authentication method.
- Mobile Friendly: The token storage is not limited to cookies, they can be stored in mobile databases;

Installation:
-------------

[](#installation)

1. Install the php-jwt library:
    `composer require firebase/php-jwt`
2. Copy the contents of src to your selected subfolder.
3. Include `JWTAuth.php` in your file with `require` or `require_once`.

**Composer support will be available soon**

Usage:
------

[](#usage)

### Instantiate JWTManager Class:

[](#instantiate-jwtmanager-class)

`$jwt = new JWTManager();`

### Generate a token:

[](#generate-a-token)

In order to generate a token, we have to pass the extra data that will be in the token, for example:
`$token = $jwt-> encodeToken("admin");`

### Decode and verify a token:

[](#decode-and-verify-a-token)

`$data = $jwt-> decodeToken($jwt);`

The method `decodeToken` will return a JSON:

KeyDescriptionValuevalidDefines whether the token is valid or notBooleanmessageDescription of the token verification resultStringscopeExtra data in the tokenStringExamples of the returned JSON:
**Success**:

`{"valid":true,"message":"Token is valid","scope":"admin"}`

**Error**:

`{"valid":false,"message":"Expired token"}`

Credits:
--------

[](#credits)

[PHP JWT Library](https://github.com/firebase/php-jwt)
Copyright (c) 2011, Neuman Vong
All rights reserved.

Contributing:
-------------

[](#contributing)

Issues, Pull requests and questions are very welcome.

License:
--------

[](#license)

This project is licensed under the \[MIT License\] () and the [PHP JWT Library](https://github.com/firebase/php-jwt) is licensed under \[3-Clause BSD\] ().

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~5 days

Total

4

Last Release

3354d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/51ee3c3f15a9b57cdee86c044c6f2beca7cbb512f4e9b7332e62e3b1f31a2a49?d=identicon)[igor-lopes](/maintainers/igor-lopes)

---

Top Contributors

[![Igor-Lopes](https://avatars.githubusercontent.com/u/11265789?v=4)](https://github.com/Igor-Lopes "Igor-Lopes (15 commits)")

### Embed Badge

![Health badge](/badges/igor-php-jwt-manager/health.svg)

```
[![Health](https://phpackages.com/badges/igor-php-jwt-manager/health.svg)](https://phpackages.com/packages/igor-php-jwt-manager)
```

###  Alternatives

[google/auth

Google Auth Library for PHP

1.4k272.7M162](/packages/google-auth)[thenetworg/oauth2-azure

Azure Active Directory OAuth 2.0 Client Provider for The PHP League OAuth2-Client

2509.6M48](/packages/thenetworg-oauth2-azure)[stevenmaguire/oauth2-keycloak

Keycloak OAuth 2.0 Client Provider for The PHP League OAuth2-Client

2275.9M27](/packages/stevenmaguire-oauth2-keycloak)[robsontenorio/laravel-keycloak-guard

🔑 Simple Keycloak Guard for Laravel

5161.1M3](/packages/robsontenorio-laravel-keycloak-guard)[patrickbussmann/oauth2-apple

Sign in with Apple OAuth 2.0 Client Provider for The PHP League OAuth2-Client

1132.5M6](/packages/patrickbussmann-oauth2-apple)[wp-graphql/wp-graphql-jwt-authentication

JWT Authentication for WPGraphQL

361118.4k1](/packages/wp-graphql-wp-graphql-jwt-authentication)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
