PHPackages                             php-istio/jwt-payload-extractor - 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. php-istio/jwt-payload-extractor

AbandonedArchivedLibrary

php-istio/jwt-payload-extractor
===============================

Library to help extract JWT payload from Istio Envoy proxy.

v1.1.1(4y ago)230.7k1MITPHPPHP &gt;=8.0

Since Jun 24Pushed 4y agoCompare

[ Source](https://github.com/php-istio/jwt-payload-extractor)[ Packagist](https://packagist.org/packages/php-istio/jwt-payload-extractor)[ RSS](/packages/php-istio-jwt-payload-extractor/feed)WikiDiscussions 1.1 Synced 3d ago

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

JWT Payload Extractor
=====================

[](#jwt-payload-extractor)

[![unit tests](https://github.com/php-istio/jwt-payload-extractor/actions/workflows/unit-tests.yml/badge.svg)](https://github.com/php-istio/jwt-payload-extractor/actions/workflows/unit-tests.yml/badge.svg)[![coding standards](https://github.com/php-istio/jwt-payload-extractor/actions/workflows/coding-standards.yml/badge.svg)](https://github.com/php-istio/jwt-payload-extractor/actions/workflows/coding-standards.yml/badge.svg)[![codecov](https://camo.githubusercontent.com/ab7c25a617c46f94f3e89bdbc7c901bb1980e7ff5bf9445f578f216fc4fea6c3/68747470733a2f2f636f6465636f762e696f2f67682f7068702d697374696f2f6a77742d7061796c6f61642d657874726163746f722f6272616e63682f6d61696e2f67726170682f62616467652e7376673f746f6b656e3d49325a4143574f59484d)](https://codecov.io/gh/php-istio/jwt-payload-extractor)[![Latest Stable Version](https://camo.githubusercontent.com/8f898e823c86445d74f11d2c99d41da7a4502db24b91c1f5195764bb4be5d30a/687474703a2f2f706f7365722e707567782e6f72672f7068702d697374696f2f6a77742d7061796c6f61642d657874726163746f722f76)](https://packagist.org/packages/php-istio/jwt-payload-extractor)

About
-----

[](#about)

This library help to extract trusted JWT payload from request forwarded by Istio Sidecar. It's based on [PSR-7 Server Request Message](https://www.php-fig.org/psr/psr-7/) ensures interoperability with other packages and frameworks.

[![UML](assets/request.png)](assets/request.png)

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

[](#requirements)

PHP versions:

- PHP 8.0

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

[](#installation)

First install this library:

```
composer require php-istio/jwt-payload-extractor
```

And choice one of PSR-7 implementation package (ex: [nyholm/psr7-server](https://github.com/Nyholm/psr7-server/)):

```
composer require nyholm/psr7 nyholm/psr7-server
```

Usage
-----

[](#usage)

Istio [JWTRules](https://istio.io/latest/docs/reference/config/security/jwt/#JWTRule) part of [RequestAuthentication](https://istio.io/latest/docs/reference/config/security/request_authentication/) CRD (Custom Resource Definition) support forward origin token (`forwardOriginalToken` option), or just only base64 payload via specify header name (`outputPayloadToHeader` option), depend on your strategy you need to select method to extract your trusted JWT payload from forwarded request:

- Extract from origin token in header:

```
