PHPackages                             byu-oit-michael/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. byu-oit-michael/jwt

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

byu-oit-michael/jwt
===================

JWT decoder/validator for BYU API

v2.1.3(6y ago)012MITPHP

Since Apr 4Pushed 6y agoCompare

[ Source](https://github.com/Michael4d45/byu-jwt-php)[ Packagist](https://packagist.org/packages/byu-oit-michael/jwt)[ RSS](/packages/byu-oit-michael-jwt/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (1)Dependencies (5)Versions (9)Used By (0)

JWT Decoding and Validation for BYU API
=======================================

[](#jwt-decoding-and-validation-for-byu-api)

Basic JWT Decoding and Validation for calls from BYU's API repository

Requirements
============

[](#requirements)

- PHP 7.0+
- OpenSSL extension

Installing via composer
-----------------------

[](#installing-via-composer)

`composer require byu-oit-michael/jwt`

Usage
-----

[](#usage)

The most common use case is simply decoding a JWT:

```
try {
    $decoded = (new BYUJWT)->decode($jwt);
} catch (Exception $e) {
    //JWT was not valid, do something
}
```

The output is an array with the original JWT data, plus the standard BYU claims parsed out, e.g.

```
[
	'iss' => 'https://api.byu.edu',
	'exp' => 1492013286,
	'http://wso2.org/claims/subscriber' => 'BYU/appnetid',
	'http://wso2.org/claims/applicationid' => '1234',
	'http://wso2.org/claims/applicationname' => 'DefaultApplication',
	'http://wso2.org/claims/applicationtier' => 'Unlimited',
	'http://wso2.org/claims/apicontext' => '/echo/v1',
	'http://wso2.org/claims/version' => 'v1',
	'http://wso2.org/claims/tier' => 'Unlimited',
	'http://wso2.org/claims/keytype' => 'SANDBOX',
	'http://wso2.org/claims/usertype' => 'APPLICATION_USER',
	'http://wso2.org/claims/enduser' => 'usernetid@carbon.super',
	'http://wso2.org/claims/enduserTenantId' => '-1234',
	'http://byu.edu/claims/resourceowner_suffix' => ' ',
	'http://byu.edu/claims/client_rest_of_name' => 'Appfirstname',
	'http://byu.edu/claims/resourceowner_person_id' => '123456789',
	'http://byu.edu/claims/resourceowner_byu_id' => '987654321',
	'http://wso2.org/claims/client_id' => 'XcnfjpwGZUjQVeItRzfWbY8AAw0a',
	'http://byu.edu/claims/resourceowner_net_id' => 'usernetid',
	'http://byu.edu/claims/resourceowner_surname' => 'Userlastname',
	'http://byu.edu/claims/client_person_id' => '111111111',
	'http://byu.edu/claims/client_sort_name' => 'Applastname, Appfirstname',
	'http://byu.edu/claims/client_claim_source' => 'CLIENT_SUBSCRIBER',
	'http://byu.edu/claims/client_net_id' => 'appnetid',
	'http://byu.edu/claims/client_subscriber_net_id' => 'appnetid',
	'http://byu.edu/claims/resourceowner_prefix' => ' ',
	'http://byu.edu/claims/resourceowner_surname_position' => 'L',
	'http://byu.edu/claims/resourceowner_rest_of_name' => 'Userfirstname',
	'http://byu.edu/claims/client_name_suffix' => ' ',
	'http://byu.edu/claims/client_surname' => 'Applastname',
	'http://byu.edu/claims/client_name_prefix' => ' ',
	'http://byu.edu/claims/client_surname_position' => 'L',
	'http://byu.edu/claims/resourceowner_preferred_first_name' => 'Userfirstname',
	'http://byu.edu/claims/client_byu_id' => '222222222',
	'http://byu.edu/claims/client_preferred_first_name' => 'Appfirstname',
	'http://byu.edu/claims/resourceowner_sort_name' => 'Userlastname, Userfirstname',
	'byu' => [
		'client' => [
			'byuId' => '222222222',
			'claimSource' => 'CLIENT_SUBSCRIBER',
			'netId' => 'appnetid',
			'personId' => '111111111',
			'preferredFirstName' => 'Appfirstname',
			'prefix' => ' ',
			'restOfName' => 'Appfirstname',
			'sortName' => 'Applastname, Appfirstname',
			'subscriberNetId' => 'appnetid',
			'suffix' => ' ',
			'surname' => 'Applastname',
			'surnamePosition' => 'L',
		],
		'resourceOwner' => [
			'byuId' => '987654321',
			'netId' => 'usernetid',
			'personId' => '123456789',
			'preferredFirstName' => 'Userfirstname',
			'prefix' => ' ',
			'restOfName' => 'Userfirstname',
			'sortName' => 'Userlastname, Userfirstname',
			'suffix' => ' ',
			'surname' => 'Userlastname',
			'surnamePosition' => 'L',
		],
		'webresCheck' => [
			'byuId' => '987654321',
			'netId' => 'usernetid',
			'personId' => '123456789',
		],
	],
	'wso2' => [
		'apiContext' => '/echo/v1',
		'application' => [
			'id' => '2350',
			'name' => 'DefaultApplication',
			'tier' => 'Unlimited',
		],
		'clientId' => 'XcnfjpwGZUjQVeItRzfWbY8AAw0a',
		'endUser' => 'usernetid@carbon.super',
		'endUserTenantId' => '-1234',
		'keyType' => 'SANDBOX',
		'subscriber' => 'BYU/appnetid',
		'tier' => 'Unlimited',
		'userType' => 'APPLICATION_USER',
		'version' => 'v1',
	],
]
```

Note that `php $decoded['byu']['webresCheck'] ` contains the identifiers for the 'resourceOwner' (i.e. the end user) if present, or the 'client' (i.e. the application owner) if not.

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~234 days

Total

8

Last Release

2381d ago

Major Versions

v1.1.0 → v2.0.02017-04-10

### Community

Maintainers

![](https://www.gravatar.com/avatar/c2262f27ff08e3a2649bcc587627ab4a14d3f26d2d2466b3d31d2f5284957c1a?d=identicon)[Michael4d45](/maintainers/Michael4d45)

---

Top Contributors

[![snelg](https://avatars.githubusercontent.com/u/5741887?v=4)](https://github.com/snelg "snelg (31 commits)")[![pauldeden](https://avatars.githubusercontent.com/u/4304479?v=4)](https://github.com/pauldeden "pauldeden (12 commits)")[![joshgubler](https://avatars.githubusercontent.com/u/9257908?v=4)](https://github.com/joshgubler "joshgubler (6 commits)")[![eric-nord](https://avatars.githubusercontent.com/u/2634204?v=4)](https://github.com/eric-nord "eric-nord (5 commits)")[![Michael4d45](https://avatars.githubusercontent.com/u/2423882?v=4)](https://github.com/Michael4d45 "Michael4d45 (3 commits)")[![bwinterton](https://avatars.githubusercontent.com/u/5790659?v=4)](https://github.com/bwinterton "bwinterton (3 commits)")[![ndpete](https://avatars.githubusercontent.com/u/4553244?v=4)](https://github.com/ndpete "ndpete (3 commits)")[![casture](https://avatars.githubusercontent.com/u/3672534?v=4)](https://github.com/casture "casture (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/byu-oit-michael-jwt/health.svg)

```
[![Health](https://phpackages.com/badges/byu-oit-michael-jwt/health.svg)](https://phpackages.com/packages/byu-oit-michael-jwt)
```

###  Alternatives

[google/auth

Google Auth Library for PHP

1.4k272.7M162](/packages/google-auth)[laravel/socialite

Laravel wrapper around OAuth 1 &amp; OAuth 2 libraries.

5.7k96.9M674](/packages/laravel-socialite)[ellaisys/aws-cognito

AWS Cognito package that allows Auth and other related features using the AWS SDK for PHP

120220.7k1](/packages/ellaisys-aws-cognito)[clerkinc/backend-php

2755.0k](/packages/clerkinc-backend-php)[kinde-oss/kinde-auth-php

Kinde PHP SDK for authentication

2369.5k3](/packages/kinde-oss-kinde-auth-php)

PHPackages © 2026

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