PHPackages                             pdmfc/laravel-saml2idp-php-8-support - 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. pdmfc/laravel-saml2idp-php-8-support

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

pdmfc/laravel-saml2idp-php-8-support
====================================

Make your Laravel application an Identification Provider using SAML 2.0.

05.6k↓50%PHP

Since Feb 15Pushed 2y ago1 watchersCompare

[ Source](https://github.com/pdmfc/laravel-saml2idp-php-8-support)[ Packagist](https://packagist.org/packages/pdmfc/laravel-saml2idp-php-8-support)[ RSS](/packages/pdmfc-laravel-saml2idp-php-8-support/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Fork of laravel SAMLIDP PHP library

FOR LARAVEL 7
-------------

[](#for-laravel-7)

use the 2.0.0 version

FOR LARAVEL 6
-------------

[](#for-laravel-6)

use the 1.0.0 version

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

[](#installation)

Add this on composer repositories section:

```
{
    "type": "vcs",
    "url": "https://github.com/pdmfc/laravel-saml2idp-php-8-support.git"
}
```

Require this package with composer:

```
composer require pdmfc/laravel-saml2idp-php-8-support:*
```

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:

```
