happy-dev / saml-laravel
SAMLv2 Laravel client
1.0.3
2018-09-06 20:02 UTC
Requires
- php: ^7.0 || ^7.1
- onelogin/php-saml: 2.14.0
README
A Laravel 5 package to handle SAML v2 auth.
Installation
composer require happy-dev/saml-laravel
add the middleware to
app/Http/Kernel.php
$routeMiddleware = [
'saml' => \HappyDev\Saml\SamlClient\Auth\Middlewares\SamlAuthenticate::class
]
- Publish the
config/saml.php
file with
php artisan vendor:publish
select the right provider by hitting the corresponding number
- 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
- Update classmap and auto-discover the package
composer dump autoload
- Clear caches
php artisan config:clear
php artisan routes:clear
- use the middleware in your routes:
['middleware' => 'saml']
- Create a
UserService
class UserService implements \HappyDev\Saml\Interfaces\SamlUserService
{
public function findOrCreate(array $attributes) {}
}