arietimmerman/laravel-saml

Laravel Package for creating a SAML identity provider

Maintainers

👁 arietimmerman

Package info

github.com/arietimmerman/laravel-saml

Issues

pkg:composer/arietimmerman/laravel-saml

Statistics

Installs: 485

Dependents: 0

Suggesters: 0

Stars: 6

v0.5.6 2022-11-03 20:26 UTC

Requires

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 613afbf5f089b5b5cd20859a5a177a971803f348

  • Arie Timmerman <arietimmerman.woop@gmail.com>

README

👁 Image
👁 Latest Stable Version
👁 Total Downloads

SAML for Laravel

This is an SAML Identity Provider written in PHP with Laravel, built on top of simplesamlphp/simplesamlphp and some pieces of adactive-sas/saml2-bridge-bundle.

It is used by idaas.nl: (not) yet another identity as a service platform.

This library - especially the documentation - is work in progress

Installation

composer require arietimmerman/laravel-saml

Generate a keypair.

openssl req -new -x509 -days 3652 -nodes -out public.key -keyout private.key

Exclude url from csrf protection

class VerifyCsrfToken extends Middleware
{
 /**
 * The URIs that should be excluded from CSRF verification.
 *
 * @var array
 */
 protected $except = [
 '/saml/v2/*'
 ];
}

In your routes/web.php include the following.

ArieTimmerman\Laravel\SAML\RouteProvider::routes();

On login, do something like the following

Helper::getSAMLStateOrFail()->setAuthnContext(Constants::AC_KERBEROS);
Helper::saveSAMLState();

Redirect to the following

'http://www.ice.test/saml/v2/continue/' . Helper::getSAMLStateOrFail()->id;

Example request:

http://samlidp.dev/saml/v2/login?SAMLRequest=...