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

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

codeblog/jwt
============

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

v1.0.0(7y ago)05MITPHPPHP &gt;=7.1

Since Mar 27Pushed 7y ago1 watchersCompare

[ Source](https://github.com/whallysson/jwt)[ Packagist](https://packagist.org/packages/codeblog/jwt)[ Docs](http://www.codeblog.com.br)[ RSS](/packages/codeblog-jwt/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

JWT Library
===========

[](#jwt-library)

[![Maintainer](https://camo.githubusercontent.com/ba3200569409e72085b945f85a8f330b9cc2721bf789ab0d990b120d6b7998e0/687474703a2f2f696d672e736869656c64732e696f2f62616467652f6d61696e7461696e65722d407768616c6c7973736f6e2d626c75652e7376673f7374796c653d666c61742d737175617265)](https://twitter.com/whallysson)[![Source Code](https://camo.githubusercontent.com/9e050e7a97fee48b1c5fad8b30e8e253ecd6c416266d4d6af74cc39a7c25e83d/687474703a2f2f696d672e736869656c64732e696f2f62616467652f736f757263652d636f6465626c6f672f6a77742d626c75652e7376673f7374796c653d666c61742d737175617265)](https://github.com/whallysson/jwt)[![PHP from Packagist](https://camo.githubusercontent.com/cfbf2b2812fb2293cae1919fb4b799b848496fd363ddc6e0a61f01829912a7ef/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f636f6465626c6f672f6a77742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/codeblog/jwt)[![Latest Version](https://camo.githubusercontent.com/4f8a0608ebedebcae9b48812cf38a217453317d6f10ce268d361cb7ddb7d8ddb/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f7768616c6c7973736f6e2f6a77742e7376673f7374796c653d666c61742d737175617265)](https://github.com/whallysson/jwt/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Build](https://camo.githubusercontent.com/b2adc46028af975d9844cad4f6e432c88196b68f1e5387ba0fc965cc820d5e8b/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f6275696c642f672f7768616c6c7973736f6e2f6a77742e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/whallysson/jwt)[![Quality Score](https://camo.githubusercontent.com/e028d3c39b85f699bfd952eb52886afaba3c1744da31881622ac77ec7ac05c70/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f7768616c6c7973736f6e2f6a77742e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/whallysson/jwt)[![Total Downloads](https://camo.githubusercontent.com/eaf75e92d81cae4aaf53708b91cba884ab9bca3ce2e54334402a51c676dd506b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636f6465626c6f672f6a77742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/codeblog/jwt)

###### JWT is a component that simplifies the handling of authentication in APIs. JWT contains information and metadata that describes the user's entity, authorization data, token validity, valid domain, etc.

[](#jwt-is-a-component-that-simplifies-the-handling-of-authentication-in-apis-jwt-contains-information-and-metadata-that-describes-the-users-entity-authorization-data-token-validity-valid-domain-etc)

JWT é um componente que simplifica o tratamento de autenticação em APIs. JWT contém informações e metadados que descrevem a entidade do usuário, dados de autorização, validade do token, domínio válido, etc.

### Highlights

[](#highlights)

- Simple installation (Instalação simples)
- Creating authenticated tokens for API (Criação de tokens autenticados para API)
- Token authenticity check (Verificação de autenticidade do token)
- Token expiration check (Verificação de expiração do token)

Installation
------------

[](#installation)

JWT is available via Composer:

```
"codeblog/jwt": "^1.0"
```

or run

```
composer require codeblog/jwt
```

Documentation
-------------

[](#documentation)

###### For details on how to use, see a sample folder in the component directory. In it you will have an example of use for each class. It works like this:

[](#for-details-on-how-to-use-see-a-sample-folder-in-the-component-directory-in-it-you-will-have-an-example-of-use-for-each-class-it-works-like-this)

Para mais detalhes sobre como usar, veja uma pasta de exemplo no diretório do componente. Nela terá um exemplo de uso para cada classe. Ele funciona assim:

#### Create JWT:

[](#create-jwt)

```
