2017 © Pedro Peláez
 

library laravel-auth-pubtkt

Laravel login server for mod_auth_pubtkt

image

tim-online/laravel-auth-pubtkt

Laravel login server for mod_auth_pubtkt

  • Monday, May 8, 2017
  • by LeonB
  • Repository
  • 2 Watchers
  • 0 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Laravel mod_auth_pubtkt module

This module implements the login server for the Apache mod_auth_pubtkt module., (*1)

It works by setting an additional auth_pubtkt cookie when logging in., (*2)

Installation

This package can be installed through Composer., (*3)

``` bash composer require tim-online/laravel-auth-pubtkt, (*4)


You must install this service provider. ``` php // config/app.php 'providers' => [ ... Timonline\AuthPubtkt\AuthPubtktServiceProvider::class ... ];

You can publish the config file of this package with this command:, (*5)

``` bash php artisan vendor:publish --provider="Timonline\AuthPubtkt\AuthPubtktServiceProvider", (*6)


This module works with the default Laravel login form but it needs some customisations to make the redirect to the protected application work properly. Allow the auth_pubtkt cookie to be unencrypted. Add the cookienaam as an exception to `EncryptCookies`: ``` php /** * The names of the cookies that should not be encrypted. * * @var array */ protected $except = [ 'auth_pubtkt', ];

Add the back parameter as a hidden input to your login form:, (*7)

``` blade , (*8)


And finally, after login, redirect to the back url. Edit your `Auth\LoginController`: ``` php protected function redirectTo(Request $request) { return $request->input('back', '/home'); }

To make the redirect work in Spark you can edit SparkServiceProvider and add this call in the booted method:, (*9)

``` php Spark::afterLoginRedirectTo(function() { $request = app('request'); return $request->input('back', '/home'); });, (*10)


To secure the protected application you can use something like this: ``` apache <Location /> AuthType mod_auth_pubtkt TKTAuthLoginURL https://myapp.tld/login TKTAuthTimeoutURL https://myapp.tld/login?timeout=1 TKTAuthRefreshURL https://myapp.tld/login?refresh=1 TKTAuthUnauthURL https://myapp.tld/login?unauth=1 TKTAuthRequireSSL on require valid-user </Location>

TODO

  • make ?back= work without manual customisations in view and controller
  • make the EncryptCookies middleware automatically skip the auth_pubtkt cookie
  • create a custom Laravel authentication guard for mod_auth_pubtkt
  • Add timeout, refresh & unauth notifications

The Versions

08/05 2017

dev-master

9999999-dev https://github.com/tim-online

Laravel login server for mod_auth_pubtkt

  Sources   Download

GPL-2.0

The Requires

  • php >=5.6.4
  • ext-mbstring *
  • ext-openssl *

 

laravel sso mod_auth_pubtkt

08/05 2017

0.0.1

0.0.1.0 https://github.com/tim-online

Laravel login server for mod_auth_pubtkt

  Sources   Download

GPL-2.0

The Requires

  • php >=5.6.4
  • ext-mbstring *
  • ext-openssl *

 

laravel sso mod_auth_pubtkt