PHPackages                             lukasmu/laravel-samlite - 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. lukasmu/laravel-samlite

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

lukasmu/laravel-samlite
=======================

Enable authentication against SAML identity providers for your Laravel application

v0.3.2(3y ago)158.3kMITPHPPHP ^7.3|^8.0

Since Jan 28Pushed 3y ago1 watchersCompare

[ Source](https://github.com/lukasmu/laravel-samlite)[ Packagist](https://packagist.org/packages/lukasmu/laravel-samlite)[ Docs](https://github.com/lukasmu/laravel-samlite)[ RSS](/packages/lukasmu-laravel-samlite/feed)WikiDiscussions main Synced 3d ago

READMEChangelog (1)Dependencies (6)Versions (4)Used By (0)

Enable authentication against SAML identity providers for your Laravel application
==================================================================================

[](#enable-authentication-against-saml-identity-providers-for-your-laravel-application)

[![Latest Version on Packagist](https://camo.githubusercontent.com/ebb5d65760b1a12aa6177b17b4b8aa221f1f1b036432282fdbba95e177d57740/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c756b61736d752f6c61726176656c2d73616d6c6974652e737667)](https://packagist.org/packages/lukasmu/laravel-samlite)[![tests](https://github.com/lukasmu/laravel-samlite/actions/workflows/tests.yml/badge.svg)](https://github.com/lukasmu/laravel-samlite/actions/workflows/tests.yml)[![StyleCI](https://camo.githubusercontent.com/76cab09cb6bc6587f3211eb39c7dbc078a647273b010d2a3b60b00db31b1049c/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3333333830323737302f736869656c643f6272616e63683d6d61696e267374796c653d666c6174)](https://github.styleci.io/repos/333802770?branch=main)[![Total Downloads](https://camo.githubusercontent.com/69bed5fe75a57582d49480e9be700ab8b2fc795686178cae22bfcef1a6de351f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c756b61736d752f6c61726176656c2d73616d6c6974652e737667)](https://packagist.org/packages/lukasmu/laravel-samlite)[![Coverage Status](https://camo.githubusercontent.com/b04e11853ac179c61e9155ca854371b74183f30830ab34f503718214897629ce/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6c756b61736d752f6c61726176656c2d73616d6c6974652f62616467652e7376673f6272616e63683d6d61696e)](https://coveralls.io/github/lukasmu/laravel-samlite?branch=main)

This package can be used to quickly add authentication against SAML2 identity providers to your Laravel application. This package thus makes your Laravel application a SAML2 service provider.

Please note that this package is based on [onelogin/php-saml](https://packagist.org/packages/onelogin/php-saml). It is similar to [aacotroneo/laravel-saml2](https://packagist.org/packages/aacotroneo/laravel-saml2) but as easy to use as [laravel/socialite](https://packagist.org/packages/laravel/socialite). It also tries to resemble the default Laravel authentication under the hood.

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

[](#installation)

You can install the package via composer:

```
composer require lukasmu/laravel-samlite
```

Usage
-----

[](#usage)

After installing the package make sure to set some environmental variables. For example, when you want to use [Microsoft Azure](https://portal.azure.com) as identity provider, please set up the following environmental variables:

```
SAML_IDP_AZURE_AD_IDENTIFIER=
SAML_IDP_AZURE_LOGIN_URL=
SAML_IDP_AZURE_LOGOUT_URL=
SAML_IDP_AZURE_CERT=
```

If your environmental file does not yet contain the variables `SAML_SP_PRIVATE_KEY` and `SAML_SP_CERT` also run:

```
php artisan saml:setup
```

You then want to create a Controller that extends the [authentication controller](src/Http/Controllers/SamlController.php) that ships with this package. Here is an example.

```
