cyrildewit / laravel-silent-authentication
Silent authentication methods for Laravel
Requires
- php: ^7.1
- illuminate/auth: 5.5.*|5.6.*|5.7.*|5.8.*|^6.0|^7.0
Requires (Dev)
- mockery/mockery: ^1.0
- orchestra/testbench: ~3.5.0|~3.6.0|~3.7.0|~3.8.0|^4.0|^5.0
- phpunit/phpunit: ^6.5|^7.0|^8.0
This package is auto-updated.
Last update: 2024-11-07 18:43:21 UTC
README
This Laravel >= 5.5 package allows you to silently authenticate users.
Overview
I created this package for personal usage. It's based on insights from other open source packages and online blog posts.
Documentation
In this documentation, you will find some helpful information about the use of this Laravel package.
Table of contents
Getting Started
Requirements
This package requires PHP 7.1+ and Laravel 5.5+.
Lumen is not supported!
Version information
Installation
First, you need to install the package via Composer:
composer require cyrildewit/laravel-silent-authentication
You can optionally publish the config file with:
php artisan vendor:publish --provider="CyrildeWit\LaravelSilentAuthentication\SilentAuthenticationServiceProvider" --tag="config"
Register service provider manually
If you prefer to register packages manually, you can add the following provider to your application's providers list.
// config/app.php 'providers' => [ // ... CyrildeWit\LaravelSilentAuthentication\SilentAuthenticationServiceProvider::class, ];
Usage
Default setup
This package will overwrite the default SessionGuard
by default. The customized session guard uses the SilentAuthentication
trait which will allow you silently authenticate users.
If you're not interesting in this default or if it's breaking your application, you can disable it in the config file.
SilentAuthentication trait
If you're already overwriting the default SessionGuard
in your application, you can simply implement the SilentAuthentication
trait.
use Illuminate\Auth\SessionGuard as BaseSessionGuard; use CyrildeWit\LaravelSilentAuthentication\Guards\Traits\SilentAuthentication; class SessionGuard extends BaseSessionGuard { use SilentAuthentication; }
Changelog
Please see CHANGELOG for more information on what has changed recently.
License
This project is licensed under the MIT License - see the LICENSE.md file for details.