An implementation of laravel/passport using password OAuth grant type.

This package's canonical repository appears to be gone and the package has been frozen as a result.

v1.0.1 2018-10-24 11:23 UTC

This package is not auto-updated.

Last update: 2024-01-20 23:16:19 UTC


README

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=http://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');

Installation

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',
];

Testing

To do.

Security

If you discover any security issues, please email mpj@foreno.dk instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.