Laravel Saml2

24slides/laravel-saml2 image

Laravel Saml2 stats

Downloads
550.4K
Stars
153
Open Issues
35
Forks
53

View on GitHub →

SAML2 Service Provider integration to your Laravel 5.4+ application, based on OneLogin toolkit

Laravel SAML2 Service Provider Package

The Laravel SAML2 package is designed to transform your Laravel application into a SAML-compliant Service Provider (SP), facilitating Single Sign-On (SSO) via the SAML2 protocol. Leveraging the OneLogin PHP-SAML toolkit, this package supports integration with multiple Identity Providers (IdPs), making it an ideal choice for enterprise-level applications requiring robust authentication mechanisms.

Key Features

  • Multi-IdP Support: Manage and authenticate against multiple identity providers.
  • Automatic Service Provider Registration: For Laravel 5.5+, service providers are auto-registered.
  • Customizable SAML Configuration: Extensive configuration options inherited from the OneLogin toolkit.
  • Tenant Management: Unique system for handling multiple IdPs using tenant entities.
  • Event Handling: Easy to use event listeners for SAML authentication events.
  • Pre-configured Routes: Built-in routes for SAML actions which can be customized or disabled.
  • SSO Friendly Links: Helper functions to generate SSO-compatible links, ideal for email integration.

Installation and Configuration

  1. Installation:

    composer require 24slides/laravel-saml2
  2. Publish Configuration:

    php artisan vendor:publish --provider="Slides\Saml2\ServiceProvider"
  3. Database Migration:

    php artisan migrate
  4. Configuration: Modify the saml2.php in your app/config directory following the detailed instructions within the file, pulling settings from the OneLogin toolkit documentation as needed.

  5. Middleware Setup: Define necessary middleware for SAML routes in app/Http/Kernel.php.

Usage

  • Authentication: Add listeners for Slides\Saml2\Events\SignedIn and Slides\Saml2\Events\SignedOut to handle user sessions.
  • Tenant Management: Use artisan commands like artisan saml2:create-tenant to manage SAML tenants.
  • Logging Out: Implement SAML-compliant logout mechanisms that communicate with the IdP.

Example Setup

An example setup with Azure AD is provided, detailing how to retrieve IdP credentials, create a tenant, and configure your IdP using the generated settings.

Testing and Security

  • Run Tests: Execute vendor/bin/phpunit within the package directory.
  • Security Issues: Report any security concerns via the provided email address, not through public issue trackers.

This package is essential for developers looking to implement SAML-based SSO in their Laravel applications, providing a comprehensive toolkit for managing authentication across multiple identity providers efficiently.

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.


24Slides Laravel Saml2 Related Articles

SlideWire: Build Presentations with Livewire and Blade image

SlideWire: Build Presentations with Livewire and Blade

Read article
Build your slide deck in Laravel with Simple Slides image

Build your slide deck in Laravel with Simple Slides

Read article
PHP in 2018 image

PHP in 2018

Read article
Jack McDade’s Laracon Slides image

Jack McDade’s Laracon Slides

Read article
Dries Vints: The Laravel Ecosystem Slides image

Dries Vints: The Laravel Ecosystem Slides

Read article
Matt Stauffer: Leveraging Laravel Slidedeck image

Matt Stauffer: Leveraging Laravel Slidedeck

Read article
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Multi-tenant Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more.

SaaSykit: Laravel SaaS Starter Kit
Typesense Search logo

Typesense Search

Typesense is an open source, blazing-fast search engine, optimized for helping you build delightful search experiences for your sites and apps. Natively integrated with Laravel Scout.

Typesense Search
Securing Laravel logo

Securing Laravel

The essential security resource for Laravel devs, covering everything you need to keep your apps secure. Sign up to receive weekly security tips and monthly in depth articles, diving deep into security concepts you need to know!

Securing Laravel
Tinkerwell logo

Tinkerwell

The must-have code runner for Laravel developers. Tinker with AI, autocompletion and instant feedback on local and production environments.

Tinkerwell
Honeybadger logo

Honeybadger

Simple developer-focused application monitoring for Laravel. Error tracking, log management, uptime monitoring, status pages, and more!

Honeybadger
No Compromises logo

No Compromises

Joel and Aaron, the two seasoned devs from the No Compromises podcast, are now available to hire for your Laravel project. ⬧ Flat rate of $9500/mo. ⬧ No lengthy sales process. ⬧ No contracts. ⬧ 100% money back guarantee.

No Compromises