zeroone / auth-server
AuthServer implementation for Laravel 5+
2.0.1
2019-09-23 14:11 UTC
Requires
- php: ^7.1
- doctrine/dbal: ^2.8
- firebase/php-jwt: ^5.0
- laravel/framework: >=5.4
This package is auto-updated.
Last update: 2026-05-24 05:30:33 UTC
README
Instalation
It's easy as usual..
-
Require this package with composer using the following command:
composer require zeroone/auth-server
-
Add the service provider to the
providersarray inconfig/app.phpZeroone\Authserver\AuthServerServiceProvider::class,
-
Add some settings to your
.envfileAUTH_SERVER_URL=<https://auth.example.com> # auth server url AUTH_SERVER_API_KEY=<your_api_key> AUTH_SERVER_SECRET_KEY=<your_secret_key> AUTH_SERVER_CERT_FILE=<pub.crt> # certificate path AUTH_SERVER_SUCCESS_URL=/success # url, could be absolute
-
Use trait in
Usereloquentuse \Zeroone\Authserver\Http\AuthUserTrait;
-
Run migration
php artisan migrate
It upgrades your
userstable; some needed fields will be added.
Usage
New routes will be created automaticaly:
- /login
- /login/conclusion
- /register
Route::get("login", "\Zeroone\Authserver\Http\Controllers\LoginController@getLogin")->name("login"); Route::post("login/conclusion/{data?}", "\Zeroone\Authserver\Http\Controllers\LoginController@conclusion")->name("login.conclusion"); Route::get("register", "\Zeroone\AuthServer\Http\Controllers\RegisterController@getRegister")->name("register");
If you need you can use helper function to get an AuthServer instance
$authServer = auth_server();
There are some useful methods, try & enjoy ..