{"id":26009948,"url":"https://github.com/byu-oit/byu-jwt-php","last_synced_at":"2025-07-15T23:36:25.900Z","repository":{"id":37588033,"uuid":"69040540","full_name":"byu-oit/byu-jwt-php","owner":"byu-oit","description":"JWT Decoding and Validation for BYU API","archived":false,"fork":false,"pushed_at":"2025-07-11T22:42:25.000Z","size":131,"stargazers_count":1,"open_issues_count":3,"forks_count":1,"subscribers_count":26,"default_branch":"master","last_synced_at":"2025-07-12T00:29:04.754Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/byu-oit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-23T16:07:40.000Z","updated_at":"2025-07-11T22:41:05.000Z","dependencies_parsed_at":"2025-03-05T22:29:59.126Z","dependency_job_id":"86a4be5b-1470-42c9-bfc7-1fdeeed3417c","html_url":"https://github.com/byu-oit/byu-jwt-php","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/byu-oit/byu-jwt-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byu-oit%2Fbyu-jwt-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byu-oit%2Fbyu-jwt-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byu-oit%2Fbyu-jwt-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byu-oit%2Fbyu-jwt-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/byu-oit","download_url":"https://codeload.github.com/byu-oit/byu-jwt-php/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byu-oit%2Fbyu-jwt-php/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265467610,"owners_count":23770751,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-05T22:26:36.443Z","updated_at":"2025-07-15T23:36:25.878Z","avatar_url":"https://github.com/byu-oit.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JWT Decoding and Validation for BYU API\n\nBasic JWT Decoding and Validation for calls from BYU's API repository\n\n# Requirements\n* PHP 5.4+\n* OpenSSL extension\n\n## Installing via composer\n\nInstall into your project using [composer](http://getcomposer.org).\nFor existing applications you can add the\nfollowing to your composer.json file:\n\n    \"require\": {\n        \"byu-oit/jwt\": \"~2.0\"\n    }\n\nAnd run `php composer.phar update`\n\n## Usage\n\nThe most common use case is simply decoding a JWT:\n```php\ntry {\n    $decoded = (new BYUJWT)-\u003edecode($jwt);\n} catch (Exception $e) {\n    //JWT was not valid, do something\n}\n```\n\nThe output is an array with the original JWT data, plus the standard BYU claims parsed out, e.g.\n```php\n[\n\t'iss' =\u003e 'https://api.byu.edu',\n\t'exp' =\u003e 1492013286,\n\t'http://wso2.org/claims/subscriber' =\u003e 'BYU/appnetid',\n\t'http://wso2.org/claims/applicationid' =\u003e '1234',\n\t'http://wso2.org/claims/applicationname' =\u003e 'DefaultApplication',\n\t'http://wso2.org/claims/applicationtier' =\u003e 'Unlimited',\n\t'http://wso2.org/claims/apicontext' =\u003e '/echo/v1',\n\t'http://wso2.org/claims/version' =\u003e 'v1',\n\t'http://wso2.org/claims/tier' =\u003e 'Unlimited',\n\t'http://wso2.org/claims/keytype' =\u003e 'SANDBOX',\n\t'http://wso2.org/claims/usertype' =\u003e 'APPLICATION_USER',\n\t'http://wso2.org/claims/enduser' =\u003e 'usernetid@carbon.super',\n\t'http://wso2.org/claims/enduserTenantId' =\u003e '-1234',\n\t'http://byu.edu/claims/resourceowner_suffix' =\u003e ' ',\n\t'http://byu.edu/claims/client_rest_of_name' =\u003e 'Appfirstname',\n\t'http://byu.edu/claims/resourceowner_person_id' =\u003e '123456789',\n\t'http://byu.edu/claims/resourceowner_byu_id' =\u003e '987654321',\n\t'http://wso2.org/claims/client_id' =\u003e 'XcnfjpwGZUjQVeItRzfWbY8AAw0a',\n\t'http://byu.edu/claims/resourceowner_net_id' =\u003e 'usernetid',\n\t'http://byu.edu/claims/resourceowner_surname' =\u003e 'Userlastname',\n\t'http://byu.edu/claims/client_person_id' =\u003e '111111111',\n\t'http://byu.edu/claims/client_sort_name' =\u003e 'Applastname, Appfirstname',\n\t'http://byu.edu/claims/client_claim_source' =\u003e 'CLIENT_SUBSCRIBER',\n\t'http://byu.edu/claims/client_net_id' =\u003e 'appnetid',\n\t'http://byu.edu/claims/client_subscriber_net_id' =\u003e 'appnetid',\n\t'http://byu.edu/claims/resourceowner_prefix' =\u003e ' ',\n\t'http://byu.edu/claims/resourceowner_surname_position' =\u003e 'L',\n\t'http://byu.edu/claims/resourceowner_rest_of_name' =\u003e 'Userfirstname',\n\t'http://byu.edu/claims/client_name_suffix' =\u003e ' ',\n\t'http://byu.edu/claims/client_surname' =\u003e 'Applastname',\n\t'http://byu.edu/claims/client_name_prefix' =\u003e ' ',\n\t'http://byu.edu/claims/client_surname_position' =\u003e 'L',\n\t'http://byu.edu/claims/resourceowner_preferred_first_name' =\u003e 'Userfirstname',\n\t'http://byu.edu/claims/client_byu_id' =\u003e '222222222',\n\t'http://byu.edu/claims/client_preferred_first_name' =\u003e 'Appfirstname',\n\t'http://byu.edu/claims/resourceowner_sort_name' =\u003e 'Userlastname, Userfirstname',\n\t'byu' =\u003e [\n\t\t'client' =\u003e [\n\t\t\t'byuId' =\u003e '222222222',\n\t\t\t'claimSource' =\u003e 'CLIENT_SUBSCRIBER',\n\t\t\t'netId' =\u003e 'appnetid',\n\t\t\t'personId' =\u003e '111111111',\n\t\t\t'preferredFirstName' =\u003e 'Appfirstname',\n\t\t\t'prefix' =\u003e ' ',\n\t\t\t'restOfName' =\u003e 'Appfirstname',\n\t\t\t'sortName' =\u003e 'Applastname, Appfirstname',\n\t\t\t'subscriberNetId' =\u003e 'appnetid',\n\t\t\t'suffix' =\u003e ' ',\n\t\t\t'surname' =\u003e 'Applastname',\n\t\t\t'surnamePosition' =\u003e 'L',\n\t\t],\n\t\t'resourceOwner' =\u003e [\n\t\t\t'byuId' =\u003e '987654321',\n\t\t\t'netId' =\u003e 'usernetid',\n\t\t\t'personId' =\u003e '123456789',\n\t\t\t'preferredFirstName' =\u003e 'Userfirstname',\n\t\t\t'prefix' =\u003e ' ',\n\t\t\t'restOfName' =\u003e 'Userfirstname',\n\t\t\t'sortName' =\u003e 'Userlastname, Userfirstname',\n\t\t\t'suffix' =\u003e ' ',\n\t\t\t'surname' =\u003e 'Userlastname',\n\t\t\t'surnamePosition' =\u003e 'L',\n\t\t],\n\t\t'webresCheck' =\u003e [\n\t\t\t'byuId' =\u003e '987654321',\n\t\t\t'netId' =\u003e 'usernetid',\n\t\t\t'personId' =\u003e '123456789',\n\t\t],\n\t],\n\t'wso2' =\u003e [\n\t\t'apiContext' =\u003e '/echo/v1',\n\t\t'application' =\u003e [\n\t\t\t'id' =\u003e '2350',\n\t\t\t'name' =\u003e 'DefaultApplication',\n\t\t\t'tier' =\u003e 'Unlimited',\n\t\t],\n\t\t'clientId' =\u003e 'XcnfjpwGZUjQVeItRzfWbY8AAw0a',\n\t\t'endUser' =\u003e 'usernetid@carbon.super',\n\t\t'endUserTenantId' =\u003e '-1234',\n\t\t'keyType' =\u003e 'SANDBOX',\n\t\t'subscriber' =\u003e 'BYU/appnetid',\n\t\t'tier' =\u003e 'Unlimited',\n\t\t'userType' =\u003e 'APPLICATION_USER',\n\t\t'version' =\u003e 'v1',\n\t],\n]\n```\n\nNote 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.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyu-oit%2Fbyu-jwt-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbyu-oit%2Fbyu-jwt-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyu-oit%2Fbyu-jwt-php/lists"}