A Laravel auth package for API authentication.
soumen-dey/api-authenticator is a Laravel package for a laravel auth package for api authentication..
It currently has 0 GitHub stars and 21 downloads on Packagist (latest version v1.0).
Install it with composer require soumen-dey/api-authenticator.
Discover more Laravel packages by soumen-dey
or browse all Laravel packages to compare alternatives.
Last updated
A Laravel package for API Authentication based on Laravel Passport.
Via Composer
$ composer require soumen-dey/api-authenticator
This package uses the default implementation for Auth that Laravel ships out of the box for validation and various other purposes.
So the validation, user table structure (except for the tokens part) should be similar for both web and api.
Note: This package uses the default User model in the App\Usernamespace. Feel free to modify the source code if you want to change this.
In your routes/api.php file, add the following:
Authenticator::routes();
This will add the required routes which are:
POST api/register
POST api/login
Note: Make sure that your request has these headers:
Content-Type: application/json
X-Requested-With: XMLHttpRequest
These are the API endpoints for authenticating users. The payload for these endpoints should be same as for the web auth, any extra payload depends on the application's logic.
Please see the changelog for more information on what has changed recently.
Please see contributing.md for details and a todolist.
If you discover any security related issues, please email author email instead of using the issue tracker.
license. Please see the license file for more information.