The olymbytes/z00s
package allows you to easily add an api login proxy to your application.
All you have to do to get started is:
Update the .env
file:
PASSWORD_CLIENT_ID={clientId}
PASSWORD_CLIENT_SECRET={secret}
OAUTH_TOKEN_URL=https://example.org/oauth/token
// Add this in your `routes/web.php`, where `AppController` link to your SPA controller.
Route::get('password/reset/{token}', 'AppController')->name('password.reset');
You can install the package via composer:
$ composer require olymbytes/z00s
The package will automatically register itself.
You can publish the config with:
$ php artisan vendor:publish --provider="Olymbytes\Z00s\Z00sServiceProvider" --tag="config"
This is the contents of the published config file:
<?php
return [
/*
* Credentials for the user based provider
*/
'credentials' => [
'password_client_id' => env('PASSWORD_CLIENT_ID', ''),
'password_client_secret' => env('PASSWORD_CLIENT_SECRET', ''),
'provider' => Olymbytes\Z00s\Auth\Credentials\EnvFileProvider::class,
],
/*
* The url to get access token, refresh token, etc. from.
*/
'oauth_token_url' => env('OAUTH_TOKEN_URL', ''),
/*
* The prefix that should be used for the z00s routes.
*/
'route_prefix' => 'api',
/*
* The field to use as username.
*/
'username_field' => 'email',
];
To do.
If you discover any security issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.