happy-dev/saml-laravel

SAMLv2 Laravel client

1.0.3 2018-09-06 20:02 UTC

This package is auto-updated.

Last update: 2024-04-11 03:19:24 UTC


README

A Laravel 5 package to handle SAML v2 auth.

Installation

  1. composer require happy-dev/saml-laravel

  2. add the middleware to app/Http/Kernel.php

$routeMiddleware = [
	'saml' => \HappyDev\Saml\SamlClient\Auth\Middlewares\SamlAuthenticate::class
]
  1. Publish the config/saml.php file with
php artisan vendor:publish

select the right provider by hitting the corresponding number

  1. Add your configuration from your SAML provider
SAML_ENABLED=true
SAML_CONNECT=true
SAML_URL_PREFIX=saml
SAML_IDP_ENTITYID=""
SAML_IDP_SSO=""
SAML_IDP_X509CERT=""
SAML_ATTRIBUTE_EMAIL=Email
SAML_ATTRIBUTE_NAME="FirstName LastName"
SAML_DUMP_ATTRIBUTES=false
  1. Update classmap and auto-discover the package composer dump autoload
  2. Clear caches
php artisan config:clear
php artisan routes:clear
  1. use the middleware in your routes: ['middleware' => 'saml']
  2. Create a UserService
class UserService implements \HappyDev\Saml\Interfaces\SamlUserService
{
	public function findOrCreate(array $attributes) {}
}