PHPackages                             phpnomad/firebase-jwt-integration - 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. phpnomad/firebase-jwt-integration

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

phpnomad/firebase-jwt-integration
=================================

1.0.0(1y ago)0221MITPHPCI failing

Since Dec 18Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/phpnomad/firebase-jwt-integration)[ Packagist](https://packagist.org/packages/phpnomad/firebase-jwt-integration)[ Docs](https://github.com/phoenix/core)[ RSS](/packages/phpnomad-firebase-jwt-integration/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (3)Versions (3)Used By (1)

phpnomad/firebase-jwt-integration
=================================

[](#phpnomadfirebase-jwt-integration)

[![Latest Version](https://camo.githubusercontent.com/109c24ac80e9b0cd92c249477ddcbdd95f7de612b1669d95d6aee6ddf1942113/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7068706e6f6d61642f66697265626173652d6a77742d696e746567726174696f6e2e737667)](https://packagist.org/packages/phpnomad/firebase-jwt-integration)[![Total Downloads](https://camo.githubusercontent.com/4ffc3bd39400cb43ec26eaaec644bcccc6ac24e4d2f0e7066d0290be858764c1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7068706e6f6d61642f66697265626173652d6a77742d696e746567726174696f6e2e737667)](https://packagist.org/packages/phpnomad/firebase-jwt-integration)[![PHP Version](https://camo.githubusercontent.com/ac94ed0ec7b0b8a9dcf976977869294bfa0aab3aa40aff602f8168fc71637af5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7068706e6f6d61642f66697265626173652d6a77742d696e746567726174696f6e2e737667)](https://packagist.org/packages/phpnomad/firebase-jwt-integration)[![License](https://camo.githubusercontent.com/0503f6331d6eebb5075cc0e08cb16527d838cc66075331947885c069927ea06b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7068706e6f6d61642f66697265626173652d6a77742d696e746567726174696f6e2e737667)](https://packagist.org/packages/phpnomad/firebase-jwt-integration)

Integrates the [firebase/php-jwt](https://github.com/firebase/php-jwt) library with `phpnomad/auth`'s `JwtStrategy` interface. It provides a single concrete strategy that encodes payloads into HS256-signed JSON Web Tokens and decodes them back into arrays, translating firebase/php-jwt's exception types into `PHPNomad\Auth\Exceptions\JwtException` so the rest of your application only has to catch one thing.

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

[](#installation)

```
composer require phpnomad/firebase-jwt-integration
```

What This Provides
------------------

[](#what-this-provides)

- A `FirebaseJwt` strategy class that implements `PHPNomad\Auth\Interfaces\JwtStrategy` using `firebase/php-jwt`, with HS256 for both encoding and verification.
- Exception translation that maps `ExpiredException`, `SignatureInvalidException`, `BeforeValidException`, and the standard PHP value errors into `PHPNomad\Auth\Exceptions\JwtException` with descriptive messages.

Requirements
------------

[](#requirements)

- `phpnomad/auth ^1.0` for the `JwtStrategy` interface and its `JwtException` type.
- `firebase/php-jwt ^6.10` as the underlying JWT library.

Usage
-----

[](#usage)

Bind `FirebaseJwt` to the `JwtStrategy` interface inside one of your bootstrapper initializers. Any service that depends on `JwtStrategy` will then receive this implementation without knowing which library is wired in behind it.

```
