{"repo":"eljam/guzzle-jwt-middleware","free":true,"listed":false,"github":"https://github.com/eljam/guzzle-jwt-middleware","clone":"git clone https://github.com/eljam/guzzle-jwt-middleware.git","description":"Guzzle Jwt middleware","language":"PHP","stars":28,"topics":["jwt","php","json","guzzlehttp","guzzle-middleware","middleware","bearer"],"license":"MIT","category":"auth-billing-email","readme_excerpt":"Guzzle Jwt middleware Introduction Works great with LexikJWTAuthenticationBundle Installation composer require eljam/guzzle-jwt-middleware Usage Auth Strategies QueryAuthStrategy FormAuthStrategy HttpBasicAuthStrategy JsonAuthStrategy Persistence To avoid requesting a token everytime php runs, you can pass to JwtManager an implementation of TokenPersistenceInterface . By default NullTokenPersistence will be used. Simpe cache adapter (PSR-16) If you have any PSR-16 compatible cache, you can use it as a persistence handler: Optionnally you can specify the TTL and cache key used: Custom persistence You may create you own persistence handler by implementing the TokenPersistenceInterface : Token key Property accessor With the property accessor you can point to a node in your json. Json Example: Library configuration: Default behavior By default this library assumes your json response has a key token , something like this: but now you can change the token key in the JwtManager options: Null property accessor If the response is not in json format (i.e. the response body contains only the token in plain text format), you need to set the property accessor to null : Authorization Header Type Some endpoints use different Authorization header types (Bearer, JWT, etc...). The default is Bearer, but another type can be supplied in the middleware: Cached token To avoid too many calls between multiple request, there is a cache system. Json example: The bundle natively supports the exp field ","default_branch":null,"files":null,"tree":[],"storefront":"/r/eljam","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/eljam/guzzle-jwt-middleware/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}