2017 © Pedro Peláez
 

library simplersaml

Allows Simpler integration of SimpleSAML and Laravel.

image

ragingdave/simplersaml

Allows Simpler integration of SimpleSAML and Laravel.

  • Thursday, October 8, 2015
  • by DaveMC08
  • Repository
  • 2 Watchers
  • 4 Stars
  • 273 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 4 Open issues
  • 1 Versions
  • 15 % Grown

The README.md

SimplerSaml

Welcome to the even Simpler simplesamlphp integration for Laravel 5., (*1)

This library enables simple interaction between your Laravel application and using authentication from an IDP., (*2)

Feel free to bring up shortcomings in issues/PR so I can improve this and make it better for everyone., (*3)

Setup

Add the package to your composer.json:, (*4)

composer require ragingdave/simplersaml:dev-master

Add the service provider in config/app.php:, (*5)

RagingDave\SimplerSaml\SimplerSamlServiceProvider::class,

(OPTIONALLY) Publish the config to make changes:, (*6)

php artisan vendor:publish --provider="RagingDave/SimplerSaml/SimplerSamlServiceProvider" --tag="config"

Configuration

This is pretty customizable from the start so if there is something missing chances are, I missed it, and you can help improve the package by telling me about it and I'll see what I can do (OR better yet submit a PR)., (*7)

  • Saml User Model (simplersaml.model), (*8)

    • This basically just is used currently to map saml attribute names to something that is meaningful for your application. (Ideally, this should be the only part to have to override)
  • Routing (simplersaml.enableRoutes, simplersaml.routePrefix), (*9)

    • This will determine if the built in routes are registered and what they should register at.
    • A routePrefix of 'saml' will trigger routes 'saml/login' and 'saml/logout'
    • boolean value of enableRoutes will enable or disable the built-in routes entirely.
  • SP and IDP (simplersaml.sp, simplersaml.idp), (*10)

    • These are pretty self-explanatory if you are using simplesamlphp, but...
    • sp should be the configured sp in the metadata (gets passed to SimpleSAML_Auth_Simple as the authSource)
    • idp is the configured idp in the simplesamlphp metadata
  • Redirects (simplersaml.loginRedirect, simplersaml.logoutRedirect), (*11)

    • These determine the path to redirect to after login and logout (passed to redirect()->to())

Usage

So for this you can use the built-in middleware and augment them to add the saml isAuthenticated check, or use the SamlAuthenticate, and SamlRedirectIfAuthenticated included in this package. Anything more advanced like combining laravel session checking and saml session checking can be done by you by adding to the built-in Authenticate and RedirectIfAuthenticated., (*12)

There are a few events that are fired from this package to hook into the login and logout functions of the saml flow., (*13)

RagingDave\SimplerSaml\Events\SamlLogin
RagingDave\SimplerSaml\Events\SamlLogout

These can be listened for and acted upon to enable creating/logging in the saml user into a local laravel session to use, (*14)

Auth::user(), Auth::check(), etc.

throughout the application. The problem here is that if the saml session times out, the laravel session could still be valid. The middleware in this package takes care of this so take a look in `` for an example., (*15)

The Versions

08/10 2015

dev-master

9999999-dev

Allows Simpler integration of SimpleSAML and Laravel.

  Sources   Download

MIT

The Requires

 

by David Cox Jr.

laravel saml illuminate simplesaml