2017 © Pedro Peláez
 

library session-auth

image

kerchuma222/session-auth

  • Monday, August 10, 2015
  • by KerchumA222
  • Repository
  • 2 Watchers
  • 0 Stars
  • 10 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Session Based Authentication

Laravel 5 Session Authentication driver., (*1)

Implemented Features

  • Session level persistence for User information retrieved from other application

Installation

To install this driver in your application, add the following to your composer.json file, (*2)

{
  ...
  "require": {
    "laravel/framework": "5.*",
    ...
    "KerchumA222/session-auth": "3.*",
  },
  ...
  "repositories": [{
    "type": "vcs",
    "url": "https://github.com/KerchumA222/session-auth"
  }],
  ...
}

Then run composer update. NOTE: You may have to run composer with the --prefer-source flag in order to install this from GitHub. You will also need git installed on your machine. This is temporary and will be resolved when this is hosted on packagist., (*3)

Once you have finished downloading the package from GitHub you need to tell your Application to use the session-auth service provider., (*4)

Open app/config/app.php and find, (*5)

Illuminate\Auth\AuthServiceProvider::class, (*6)

and replace it with, (*7)

KerchumA222\SessionAuth\SessionAuthServiceProvider::class, (*8)

This tells Laravel 5 to use the service provider from the vendor folder., (*9)

You also need to direct Auth to use the session driver instead of Eloquent or Database, edit config/auth.php and change driver to session, (*10)

Configuration

No configuration needed in the client application. The Authenticating application needs to store user details in the shared Session in the key 'currentUser'. The required details of the currentUser are 'id', 'username' (or whatever your primary identifier is), and 'remember_token' (for remembering users in the child applications without going back to the authentication application)., (*11)

Example

In your authentication application (which should NOT include this plugin) Session::put('currentUser', ['id'=>1, 'username'=>'KerchumA222', 'remember_token'=>'xxxxxxx', 'groups'=>['Admin', 'User']]); This can be conveniently done in the Authentication.php middleware., (*12)

Usage

Use of Auth is the same as with the default service provider. Auth::user() returns an instance of GenericUser with all the details stored in Session by the parent application., (*13)

Model Usage

You do not use a model with this implementation., (*14)

The Versions

10/08 2015

dev-master

9999999-dev

  Sources   Download

The Requires

 

The Development Requires

by Alexander Kerchum

laravel authentication lumen laravel 5 l5 session laravel 5.1

10/08 2015

1.1.1

1.1.1.0

  Sources   Download

The Requires

 

The Development Requires

by Alexander Kerchum

laravel authentication lumen laravel 5 l5 session laravel 5.1

10/08 2015

dev-1.1-beta

dev-1.1-beta

  Sources   Download

The Requires

 

The Development Requires

by Alexander Kerchum

laravel authentication lumen laravel 5 l5 session laravel 5.1

10/08 2015

v1.0

1.0.0.0

  Sources   Download

The Requires

 

The Development Requires

by Alexander Kerchum

laravel authentication lumen laravel 5 l5 session laravel 5.1

10/08 2015

1.1.0

1.1.0.0

  Sources   Download

The Requires

 

The Development Requires

by Alexander Kerchum

laravel authentication lumen laravel 5 l5 session laravel 5.1