PHPackages                             brpassos/laravel-samlidp - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. brpassos/laravel-samlidp

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

brpassos/laravel-samlidp
========================

Foked by Brpassos/laravel-samlidp. Make your PHP Laravel application an Idenification Provider using SAML 2.0. This package allows you to implement your own Identification Provider (idP) using the SAML 2.0 standard to be used with supporting SAML 2.0 Service Providers (SP).

v6.1.0(3y ago)034MITPHPPHP ^7.2.5 | ^8.0

Since Mar 20Pushed 3y agoCompare

[ Source](https://github.com/brpassos/laravel-samlidp)[ Packagist](https://packagist.org/packages/brpassos/laravel-samlidp)[ RSS](/packages/brpassos-laravel-samlidp/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (2)Dependencies (3)Versions (51)Used By (0)

[![Latest Version on Packagist](https://camo.githubusercontent.com/991f193ce97dacc0c1cedb53ed8ab8a704b697f1eb0032e73ccbc9672b7bb29e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f4272706173736f732f6c61726176656c2d73616d6c6964702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/Brpassos/laravel-samlidp)[![Total Downloads](https://camo.githubusercontent.com/c0a5619ca877f41cec596aa10e2f6ef8d39fd91ad232c8b46c002d33876eda1c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f4272706173736f732f6c61726176656c2d73616d6c6964702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/Brpassos/laravel-samlidp)

[Buy me a coffee](https://www.buymeacoffee.com/upwebdesign) ☕

Laravel SAML IdP
================

[](#laravel-saml-idp)

This package allows you to implement your own Identification Provider (idP) using the SAML 2.0 standard to be used with supporting SAML 2.0 Service Providers (SP).

Starting in version ^5.1, Laravel 9 is supported.

In this version we will be allowing for Laravel ^7.0 or ^8.0.

If you are looking for Laravel ^5.6 see [v1.0](https://github.com/Brpassos/laravel-samlidp/tree/1.0)

If you are looking for Laravel ^6.0 use [v2.0](https://github.com/Brpassos/laravel-samlidp/tree/2.0)

Installation
------------

[](#installation)

```
composer require Brpassos/laravel-samlidp
```

Configuration
=============

[](#configuration)

```
php artisan vendor:publish --tag="samlidp_config"
```

FileSystem configuration

```
// config/filesystem.php

'disks' => [

        ...

        'samlidp' => [
            'driver' => 'local',
            'root' => storage_path() . '/samlidp',
        ]
],
```

Use the following command to create a self signed certificate for your IdP. If you change the certname or keyname to anything other than the default names, you will need to update your `config/samlidp.php` config file to reflect those new file names.

```
php artisan samlidp:cert [--days  --keyname  --certname ]
```

```
Options:
  --days=      Days to add for the expiration date [default: 7800]
  --keyname=   Name of the certificate key file [default: key.pem]
  --certname=  Name of the certificate file [default: cert.pem]
```

Usage
-----

[](#usage)

Within your login view, probably `resources/views/auth/login.blade.php` add the SAMLRequest directive beneath the CSRF directive:

```
@csrf
@samlidp
```

The SAMLRequest directive will fill out the hidden input automatically when a SAMLRequest is sent by an HTTP request and therefore initiate a SAML authentication attempt. To initiate the SAML auth, the login and redirect processes need to be intervened. This is done using the Laravel events fired upon authentication.

Config
------

[](#config)

After you publish the config file, you will need to set up your Service Providers. The key for the Service Provider is a base 64 encoded Consumer Service (ACS) URL. You can get this information from your Service Provider, but you will need to base 64 encode the URL and place it in your config. This is due to config dot notation.

You may use this command to help generate a new SAML Service Provider:

```
php artisan samlidp:sp
```

Example SP in `config/samlidp.php` file:

```
