PHPackages                             tokin/json-web-tokin - 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. tokin/json-web-tokin

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

tokin/json-web-tokin
====================

A JSON Web Token Library

1.0(7y ago)02.2k↓100%MITPHP

Since Feb 11Pushed 1y agoCompare

[ Source](https://github.com/mfrost503/JsonWebTokin)[ Packagist](https://packagist.org/packages/tokin/json-web-tokin)[ RSS](/packages/tokin-json-web-tokin/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (4)Used By (0)

JsonWebTokin
============

[](#jsonwebtokin)

Tokin some webs

Description:
------------

[](#description)

This is small library that can be used to verify JSON Web Tokens. There are 2 classes that are used in this library `JsonWebToken` and `Verifier`, the `JsonWebToken` class allows to segment the pieces of the token out so they can be easily generated/derived.

To use the `Verifier`, all you will need is a `JsonWebToken` instance, as well as the key that was used to sign token (in a lot of cases this will be your Client Secret).

Examples
--------

[](#examples)

### Verifying a JWT

[](#verifying-a-jwt)

```
use Tokin\JWT\JsonWebToken;
use Tokin\JWT\Verifier;

$token = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6IjEyMzM0NjQ2NCIsImZpcnN0X25hbWUiOiJUZXN0IiwibGFzdF9uYW1lIjoiTWNUZXN0ZXJzb24iLCJlbWFpbCI6InRlc3RAdGVzdC5jb20iLCJleHBpcmVzIjoxMjMyMTQyfQ.7BHgbsBAyK0IRDKPtFOhHKFYta6_fdujngX64zMYrtg';
$key = 'abcdefghijklmno';

$verifier = new Verifier();
$jwt = new JsonWebToken($token);

return $verifier->verify($jwt, $key); // returns a boolean
```

### Retrieving Header Info From JWT

[](#retrieving-header-info-from-jwt)

```
use Tokin\JWT\JsonWebToken;

$token = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6IjEyMzM0NjQ2NCIsImZpcnN0X25hbWUiOiJUZXN0IiwibGFzdF9uYW1lIjoiTWNUZXN0ZXJzb24iLCJlbWFpbCI6InRlc3RAdGVzdC5jb20iLCJleHBpcmVzIjoxMjMyMTQyfQ.7BHgbsBAyK0IRDKPtFOhHKFYta6_fdujngX64zMYrtg';

$jwt = new JsonWebToken($token);

$headers = $jwt->getHeader(true); // this will return the JSON for the header, false will return the Base 64 URL Encoded value

// {"typ": "JWT", "alg":"HS256"}
```

### Retrieving the Payload Info From JWT

[](#retrieving-the-payload-info-from-jwt)

```
use Tokin\JWT\JsonWebToken;

$token = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6IjEyMzM0NjQ2NCIsImZpcnN0X25hbWUiOiJUZXN0IiwibGFzdF9uYW1lIjoiTWNUZXN0ZXJzb24iLCJlbWFpbCI6InRlc3RAdGVzdC5jb20iLCJleHBpcmVzIjoxMjMyMTQyfQ.7BHgbsBAyK0IRDKPtFOhHKFYta6_fdujngX64zMYrtg';

$jwt = new JsonWebToken($token);

$payload = $jwt->getPayload(true); // this will return the JSON for the header, false will return the Base 64 URL Encoded value
```

### Retrieving the Signature From JWT

[](#retrieving-the-signature-from-jwt)

```
use Tokin\JWT\JsonWebToken;

$token = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6IjEyMzM0NjQ2NCIsImZpcnN0X25hbWUiOiJUZXN0IiwibGFzdF9uYW1lIjoiTWNUZXN0ZXJzb24iLCJlbWFpbCI6InRlc3RAdGVzdC5jb20iLCJleHBpcmVzIjoxMjMyMTQyfQ.7BHgbsBAyK0IRDKPtFOhHKFYta6_fdujngX64zMYrtg';

$jwt = new JsonWebToken($token);

$signature = $jwt->getSignature();
```

### Retrieving the Original JWT

[](#retrieving-the-original-jwt)

```
use Tokin\JWT\JsonWebToken;

$token = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6IjEyMzM0NjQ2NCIsImZpcnN0X25hbWUiOiJUZXN0IiwibGFzdF9uYW1lIjoiTWNUZXN0ZXJzb24iLCJlbWFpbCI6InRlc3RAdGVzdC5jb20iLCJleHBpcmVzIjoxMjMyMTQyfQ.7BHgbsBAyK0IRDKPtFOhHKFYta6_fdujngX64zMYrtg';

$jwt = new JsonWebToken($token);

$token = $jwt->getOriginalToken();
```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance26

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity62

Established project with proven stability

 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 ~76 days

Total

2

Last Release

2576d ago

Major Versions

0.1 → 1.02019-04-29

### Community

Maintainers

![](https://www.gravatar.com/avatar/588f92f3d9bcb0e13dadd74d2ce3b8b64a149bac57dac0be356d3f56f9381ade?d=identicon)[mfrost503](/maintainers/mfrost503)

---

Top Contributors

[![mfrost503](https://avatars.githubusercontent.com/u/660067?v=4)](https://github.com/mfrost503 "mfrost503 (9 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tokin-json-web-tokin/health.svg)

```
[![Health](https://phpackages.com/badges/tokin-json-web-tokin/health.svg)](https://phpackages.com/packages/tokin-json-web-tokin)
```

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

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

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)

PHPackages © 2026

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