PHPackages                             overtrue/laravel-saml - 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. overtrue/laravel-saml

ActiveLibrary

overtrue/laravel-saml
=====================

SAML toolkit for Laravel based on OneLogin's SAML PHP Toolkit.

1.2.0(1y ago)2525.1k—9%1[1 issues](https://github.com/overtrue/laravel-saml/issues)MITPHPCI passing

Since May 19Pushed 1y ago3 watchersCompare

[ Source](https://github.com/overtrue/laravel-saml)[ Packagist](https://packagist.org/packages/overtrue/laravel-saml)[ GitHub Sponsors](https://github.com/overtrue)[ RSS](/packages/overtrue-laravel-saml/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (7)Versions (5)Used By (0)

Laravel SAML
------------

[](#laravel-saml)

SAML toolkit for Laravel based on [OneLogin's SAML PHP Toolkit](https://github.com/onelogin/php-saml).

[![Sponsor me](https://github.com/overtrue/overtrue/raw/master/sponsor-me-button-s.svg?raw=true)](https://github.com/sponsors/overtrue)

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

[](#installation)

```
composer require overtrue/laravel-saml
```

Configuration
-------------

[](#configuration)

```
php artisan vendor:publish --tag=saml-config
```

This command will add the file `config/saml.php`. This config is handled almost directly by [OneLogin](https://github.com/onelogin/php-saml) so you may get further references there, but will cover here what's really necessary. There are some other config about routes you may want to check, they are pretty straightforward.

Usage
-----

[](#usage)

If your application is only used to log in to one specified IdP, you just need to configure `idp` section in `config/saml.php`.

### idp configuration resolver

[](#idp-configuration-resolver)

In order to support multiple IdP, you need to configure the following method to get the configuration of the IdP.

```
Saml::configureIdpUsing(function($idpName): array {
    return [...];
});
```

You need to return the configuration array for IdP, see the `idp` section in `config/saml.php` for the structure.

### Entrypoints controller

[](#entrypoints-controller)

You can create a controller to perform SAML integration:

```
$ php artisan make:controller SamlController
```

Then we prepare the following 5 necessary methods.

```
