Download the PHP package supaapps/supaapps-guard without Composer
On this page you can find all versions of the php package supaapps/supaapps-guard. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download supaapps/supaapps-guard
More information about supaapps/supaapps-guard
Files in supaapps/supaapps-guard
Package supaapps-guard
Short Description A JWT Auth driver, opinionated and tailed to work with supaapps-auth-server
License MIT
Informations about the package supaapps-guard
Supaapps Auth Guard
- Installation
- ENV vars
- Add new custom guard
- Usage example
- Testing
- HTTP testing
Installation
composer require supaapps/supaapps-guard
ENV vars
add env vars to your .env
:
Add new custom guard
On config/auth.php
add the new guard
Also, set the default guard to jwt
Usage example
on routes/api.php
, add following lines
note: auth()
uses the default drive by default. If you didn't set the jwt
as default driver then you need to call auth('jwt')
on the previous usage example
Testing
You can generate JWT token for testing. It will be generated with private_key from tests folder. And will be compared with public_key
on same folder as well. example
HTTP testing
withAccessTokenFor
method is adding the Bearer
token to headers
which are sent by http tests. But you need to specify the server url somewhere on your tests. eg. tests/CreatesApplication
:
Next run your http tests, for example:
All versions of supaapps-guard with dependencies
illuminate/http Version ^10.0 || ^11.0 || ^12.0
illuminate/auth Version ^10.0 || ^11.0 || ^12.0
illuminate/contracts Version ^10.0 || ^11.0 || ^12.0
illuminate/database Version ^10.0 || ^11.0 || ^12.0
illuminate/support Version ^10.0 || ^11.0 || ^12.0
firebase/php-jwt Version ^6.10