|
28 | 28 | //JWT was not valid, do something |
29 | 29 | } |
30 | 30 | ``` |
| 31 | + |
| 32 | +The output is an array with the original JWT data, plus the standard BYU claims parsed out, e.g. |
| 33 | +```php |
| 34 | +[ |
| 35 | + 'iss' => 'https://api.byu.edu', |
| 36 | + 'exp' => 1492013286, |
| 37 | + 'http://wso2.org/claims/subscriber' => 'BYU/appnetid', |
| 38 | + 'http://wso2.org/claims/applicationid' => '1234', |
| 39 | + 'http://wso2.org/claims/applicationname' => 'DefaultApplication', |
| 40 | + 'http://wso2.org/claims/applicationtier' => 'Unlimited', |
| 41 | + 'http://wso2.org/claims/apicontext' => '/echo/v1', |
| 42 | + 'http://wso2.org/claims/version' => 'v1', |
| 43 | + 'http://wso2.org/claims/tier' => 'Unlimited', |
| 44 | + 'http://wso2.org/claims/keytype' => 'SANDBOX', |
| 45 | + 'http://wso2.org/claims/usertype' => 'APPLICATION_USER', |
| 46 | + 'http://wso2.org/claims/enduser' => ' [email protected]', |
| 47 | + 'http://wso2.org/claims/enduserTenantId' => '-1234', |
| 48 | + 'http://byu.edu/claims/resourceowner_suffix' => ' ', |
| 49 | + 'http://byu.edu/claims/client_rest_of_name' => 'Appfirstname', |
| 50 | + 'http://byu.edu/claims/resourceowner_person_id' => '123456789', |
| 51 | + 'http://byu.edu/claims/resourceowner_byu_id' => '987654321', |
| 52 | + 'http://wso2.org/claims/client_id' => 'XcnfjpwGZUjQVeItRzfWbY8AAw0a', |
| 53 | + 'http://byu.edu/claims/resourceowner_net_id' => 'usernetid', |
| 54 | + 'http://byu.edu/claims/resourceowner_surname' => 'Userlastname', |
| 55 | + 'http://byu.edu/claims/client_person_id' => '111111111', |
| 56 | + 'http://byu.edu/claims/client_sort_name' => 'Applastname, Appfirstname', |
| 57 | + 'http://byu.edu/claims/client_claim_source' => 'CLIENT_SUBSCRIBER', |
| 58 | + 'http://byu.edu/claims/client_net_id' => 'appnetid', |
| 59 | + 'http://byu.edu/claims/client_subscriber_net_id' => 'appnetid', |
| 60 | + 'http://byu.edu/claims/resourceowner_prefix' => ' ', |
| 61 | + 'http://byu.edu/claims/resourceowner_surname_position' => 'L', |
| 62 | + 'http://byu.edu/claims/resourceowner_rest_of_name' => 'Userfirstname', |
| 63 | + 'http://byu.edu/claims/client_name_suffix' => ' ', |
| 64 | + 'http://byu.edu/claims/client_surname' => 'Applastname', |
| 65 | + 'http://byu.edu/claims/client_name_prefix' => ' ', |
| 66 | + 'http://byu.edu/claims/client_surname_position' => 'L', |
| 67 | + 'http://byu.edu/claims/resourceowner_preferred_first_name' => 'Userfirstname', |
| 68 | + 'http://byu.edu/claims/client_byu_id' => '222222222', |
| 69 | + 'http://byu.edu/claims/client_preferred_first_name' => 'Appfirstname', |
| 70 | + 'http://byu.edu/claims/resourceowner_sort_name' => 'Userlastname, Userfirstname', |
| 71 | + 'byu' => [ |
| 72 | + 'client' => [ |
| 73 | + 'byuId' => '222222222', |
| 74 | + 'claimSource' => 'CLIENT_SUBSCRIBER', |
| 75 | + 'netId' => 'appnetid', |
| 76 | + 'personId' => '111111111', |
| 77 | + 'preferredFirstName' => 'Appfirstname', |
| 78 | + 'prefix' => ' ', |
| 79 | + 'restOfName' => 'Appfirstname', |
| 80 | + 'sortName' => 'Applastname, Appfirstname', |
| 81 | + 'subscriberNetId' => 'appnetid', |
| 82 | + 'suffix' => ' ', |
| 83 | + 'surname' => 'Applastname', |
| 84 | + 'surnamePosition' => 'L', |
| 85 | + ], |
| 86 | + 'resourceOwner' => [ |
| 87 | + 'byuId' => '987654321', |
| 88 | + 'netId' => 'usernetid', |
| 89 | + 'personId' => '123456789', |
| 90 | + 'preferredFirstName' => 'Userfirstname', |
| 91 | + 'prefix' => ' ', |
| 92 | + 'restOfName' => 'Userfirstname', |
| 93 | + 'sortName' => 'Userlastname, Userfirstname', |
| 94 | + 'suffix' => ' ', |
| 95 | + 'surname' => 'Userlastname', |
| 96 | + 'surnamePosition' => 'L', |
| 97 | + ], |
| 98 | + 'webresCheck' => [ |
| 99 | + 'byuId' => '987654321', |
| 100 | + 'netId' => 'usernetid', |
| 101 | + 'personId' => '123456789', |
| 102 | + ], |
| 103 | + ], |
| 104 | + 'wso2' => [ |
| 105 | + 'apiContext' => '/echo/v1', |
| 106 | + 'application' => [ |
| 107 | + 'id' => '2350', |
| 108 | + 'name' => 'DefaultApplication', |
| 109 | + 'tier' => 'Unlimited', |
| 110 | + ], |
| 111 | + 'clientId' => 'XcnfjpwGZUjQVeItRzfWbY8AAw0a', |
| 112 | + |
| 113 | + 'endUserTenantId' => '-1234', |
| 114 | + 'keyType' => 'SANDBOX', |
| 115 | + 'subscriber' => 'BYU/appnetid', |
| 116 | + 'tier' => 'Unlimited', |
| 117 | + 'userType' => 'APPLICATION_USER', |
| 118 | + 'version' => 'v1', |
| 119 | + ], |
| 120 | +] |
| 121 | +``` |
| 122 | + |
| 123 | +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. |
0 commit comments