Download the PHP package sympla/mesa-gold-bar without Composer
On this page you can find all versions of the php package sympla/mesa-gold-bar. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sympla/mesa-gold-bar
More information about sympla/mesa-gold-bar
Files in sympla/mesa-gold-bar
Package mesa-gold-bar
Short Description A library that provides remote user identification from oauth2 access tokens.
License MIT
Informations about the package mesa-gold-bar
sympla/mesa-gold-bar
Mesa Gold is a resort and bar located within the Westworld Mesa Hub. It is used by the Guests to relax at the end of their visit to the Park.
This library helps identifying users by their access tokens.
Installation
Install the package using composer:
$ composer require sympla/mesa-gold-bar ~3.0
That's it.
Usage
The authenticator gets two parameters in its constructor: a Guzzle client and an authentication endpoint, as a string. Once built, you can identify an user using either the raw token or a PSR-7 request object:
Middleware
This library now also has a SlimMiddleware for retrieving user credentials.
Just add the middleware:
Then, from any of the protected
routes, you can simply fetch the user
object
from your DIC:
Using with Laravel
After install it, register the service provider into your Laravel application
into config/app.php
:
Sympla\Auth\Laravel\ServiceProvider::class
Then, publish the configuration:
$ php artisan vendor:publish --provider="Sympla\Auth\Laravel\ServiceProvider"
Once your application is configured, go to config/auth.php
and change the guard
section:
And the providers
section:
Then, activate the auth:api
as a middleware for your api.
Using with Lumen
After install it, register the service provider, route middleware, Hash facade and enable eloquent into your Lumen application
into bootstrap/app.php
:
//Service provider
$app->register(Sympla\Auth\Lumen\ServiceProvider::class);
// Route middleware
$app->routeMiddleware([
'auth' => App\Http\Middleware\Authenticate::class,
]);
//Hash facade
$app->withFacades(true, ['Illuminate\Support\Facades\Hash' => 'Hash']);
//Enable eloquent
$app->withEloquent();
After register the service provider, install the package for publish in Lumen application
$ composer require laravelista/lumen-vendor-publish
Then, publish the configuration:
$ php artisan vendor:publish --provider="Sympla\Auth\Lumen\ServiceProvider"
Once your application is configured, go to config/auth.php
, if the file does not exist just create it, and change/create the guard
section:
And the providers
section:
Contact
Pedro Igor [email protected]
License
This project is distributed under the MIT License. Check [LICENSE][LICENSE.md] for more information.
All versions of mesa-gold-bar with dependencies
psr/http-message Version ~1.0
container-interop/container-interop Version *
firebase/php-jwt Version ^5.0