PHPackages                             rafsouza/mrk-jwt - 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. rafsouza/mrk-jwt

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

rafsouza/mrk-jwt
================

Este componente PHP oferece métodos para manipulação de JWT e JWK em arquivos .env

1.0(2y ago)15MITPHPPHP &gt;=7.4

Since Mar 24Pushed 2y ago1 watchersCompare

[ Source](https://github.com/rafaelsouzars/mrk-jwt)[ Packagist](https://packagist.org/packages/rafsouza/mrk-jwt)[ Docs](https://github.com/rafaelsouzars/mrk-jwt)[ RSS](/packages/rafsouza-mrk-jwt/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (2)Used By (0)

Mrk-Jwt
=======

[](#mrk-jwt)

[![Static Badge](https://camo.githubusercontent.com/1912705b8d5a2018c542f4a1a6cc98b84531b653dcb07450afdf4e5f10b4a93d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d302e312d677265656e)](https://camo.githubusercontent.com/1912705b8d5a2018c542f4a1a6cc98b84531b653dcb07450afdf4e5f10b4a93d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d302e312d677265656e) [![Static Badge](https://camo.githubusercontent.com/082b425492dbf50c8b5c72b97436d58c537749fca7435cd719c87a2c975a584e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7374617475732d626574612d79656c6c6f77)](https://camo.githubusercontent.com/082b425492dbf50c8b5c72b97436d58c537749fca7435cd719c87a2c975a584e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7374617475732d626574612d79656c6c6f77)

***Descrição***: Este componente PHP fornece métodos básicos para manipulação do JWT como: criação e validação do token. Além dessas funcionalidades o componente também manipula arquivos .env para armazenamento das JWK 'Json Web Key'.

### Instalação

[](#instalação)

> composer require rafsouza/mrk-jwt

### Criar um JWT

[](#criar-um-jwt)

```
require '../vendor/autoload.php';

use Rafsouza\MrkJwt\jwt;

$jwt = new JWT();

$jwt->setJWK('123');

$token = [
	'sub' => 'john',
	'iss' => 'mrk',
	'iat' => '10123030'
];

echo $jwt->createToken($token);
```

ou

```
require '../vendor/autoload.php';

use Rafsouza\MrkJwt\jwt;

$jwt = new JWT();

//$jwt->loadEnvJWK(dirname(__FILE__,2) .'\.env');
$jwt->loadEnvJWK('../.env');

$token = [
	'sub' => 'john',
	'iss' => 'mrk',
	'iat' => '10123030'
];

echo $jwt->createToken($token);
```

### Validar um JWT

[](#validar-um-jwt)

```
require '../vendor/autoload.php';

use Rafsouza\MrkJwt\jwt;

$authorization = $_SERVER["HTTP_AUTHORIZATION"];

$jwt = new JWT();
$jwt->setJWK('123');

echo $jwt->validationToken($authorization);
```

ou

```
require '../vendor/autoload.php';

use Rafsouza\MrkJwt\jwt;

$authorization = $_SERVER["HTTP_AUTHORIZATION"];

$jwt = new JWT();
//$jwt->loadEnvJWK(dirname(__FILE__,2) .'\.env');
$jwt->loadEnvJWK('../.env');

echo $jwt->validationToken($authorization);
```

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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

Unknown

Total

1

Last Release

832d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/73367873?v=4)[Rafael Souza](/maintainers/rafaelsouzars)[@rafaelsouzars](https://github.com/rafaelsouzars)

---

Top Contributors

[![rafaelsouzars](https://avatars.githubusercontent.com/u/73367873?v=4)](https://github.com/rafaelsouzars "rafaelsouzars (5 commits)")

---

Tags

composercomposer-packagejwtjwt-tokenphpphp-libraryjwtenvjwt-token

### Embed Badge

![Health badge](/badges/rafsouza-mrk-jwt/health.svg)

```
[![Health](https://phpackages.com/badges/rafsouza-mrk-jwt/health.svg)](https://phpackages.com/packages/rafsouza-mrk-jwt)
```

###  Alternatives

[firebase/php-jwt

A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.

10.0k478.8M2.7k](/packages/firebase-php-jwt)[lcobucci/jwt

A simple library to work with JSON Web Token and JSON Web Signature

7.6k338.7M1.1k](/packages/lcobucci-jwt)[tymon/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

11.7k51.8M372](/packages/tymon-jwt-auth)[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k103.2M104](/packages/namshi-jose)[web-token/jwt-framework

JSON Object Signing and Encryption library for PHP and Symfony Bundle.

95220.7M103](/packages/web-token-jwt-framework)[php-open-source-saver/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

84611.1M63](/packages/php-open-source-saver-jwt-auth)

PHPackages © 2026

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