PHPackages                             simplesamlphp/saml2-legacy - 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. simplesamlphp/saml2-legacy

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

simplesamlphp/saml2-legacy
==========================

SAML2 PHP library from SimpleSAMLphp

v4.20.1(2mo ago)0819.5k—7%13LGPL-2.1-or-laterPHPPHP ^8.3

Since Nov 5Pushed 2mo agoCompare

[ Source](https://github.com/simplesamlphp/saml2-legacy)[ Packagist](https://packagist.org/packages/simplesamlphp/saml2-legacy)[ RSS](/packages/simplesamlphp-saml2-legacy/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (17)Versions (183)Used By (3)Security (2)

SimpleSAMLphp SAML2 library
===========================

[](#simplesamlphp-saml2-library)

[![CI](https://github.com/simplesamlphp/saml2/workflows/CI/badge.svg?branch=master)](https://github.com/simplesamlphp/saml2/workflows/CI/badge.svg?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/a6bac1a9abb88d0f8e5f7506f1074c8e411e1ccb8889d6994666a90919fe3fa6/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f73696d706c6573616d6c7068702f73616d6c322f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/simplesamlphp/saml2/?branch=master)[![Coverage Status](https://camo.githubusercontent.com/593b0270a2f20e1de8a006c047360ba8f218b2f493d339e96a6d1f0417d28727/68747470733a2f2f636f6465636f762e696f2f67682f73696d706c6573616d6c7068702f73616d6c322f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/simplesamlphp/saml2)[![Type coverage](https://camo.githubusercontent.com/5da9da52b6f03f99aa323e6ed9c6ee385d3ee8638154d6e3d54be1cbbe451f50/68747470733a2f2f73686570686572642e6465762f6769746875622f73696d706c6573616d6c7068702f73616d6c322f636f7665726167652e737667)](https://shepherd.dev/github/simplesamlphp/saml2)[![Psalm Level](https://camo.githubusercontent.com/511aa8cafc1e8127f85b503a7649f73038a2c059f00cdacb8162c7e718b5229f/68747470733a2f2f73686570686572642e6465762f6769746875622f73696d706c6573616d6c7068702f73616d6c322f6c6576656c2e737667)](https://shepherd.dev/github/simplesamlphp/saml2)

A PHP library for SAML2 related functionality.

It is used by several products, most notably [SimpleSAMLphp](https://www.simplesamlphp.org) and [OpenConext](https://www.openconext.org).

Before you use it
-----------------

[](#before-you-use-it)

**DO NOT USE THIS LIBRARY UNLESS YOU ARE INTIMATELY FAMILIAR WITH THE SAML2 SPECIFICATION.**

If you are not familiar with the SAML2 specification and are simply looking to connect your application using SAML2, you should probably use [SimpleSAMLphp](https://www.simplesamlphp.org).

Note that the **HTTP Artifact Binding and SOAP client do not work** outside of SimpleSAMLphp.

Which version to pick?
----------------------

[](#which-version-to-pick)

The latest released version (`4.x` range) is the *preferred version*. The `3.x branch` is our LTS branch and will be supported as long as supported releases of [SimpleSAMLphp](https://www.simplesamlphp.org) are using this branch.

All other branches (`3.x` and earlier) are no longer supported and will not receive any maintenance or (security) fixes. Do not use these versions.

We conform to [Semantic Versioning](https://semver.org/). Be sure to check the [UPGRADING.md](UPGRADING.md) file if you are upgrading from an older version. Here you will find instructions on how to deal with BC breaking changes between versions.

Usage
-----

[](#usage)

- Install with [Composer](https://getcomposer.org/doc/00-intro.md), run the following command in your project:

```
composer require simplesamlphp/saml2:^4.0
```

- Provide the required external dependencies by extending and implementing the `\SimpleSAML\SAML2\Compat\AbstractContainer`then injecting it in the ContainerSingleton (see example below).
- **Make sure you've read the security section below**.
- Use at will.

Example:

```
    // Use Composers autoloading
    require 'vendor/autoload.php';

    // Implement the Container interface (out of scope for example)
    require 'container.php';
    \SimpleSAML\SAML2\Compat\ContainerSingleton::setContainer($container);

    // Create Issuer
    $issuer = new \SimpleSAML\SAML2\XML\saml\Issuer('https://sp.example.edu');

    // Instantiate XML Random utils
    $randomUtils = new \SimpleSAML\XML\Utils\Random();

    // Set up an AuthnRequest
    $request = new \SimpleSAML\SAML2\XML\samlp\AuthnRequest(
        $issuer,
        $randomUtils->generateId(),
        null,
        'https://idp.example.edu'
    );

    // Send it off using the HTTP-Redirect binding
    $binding = new \SimpleSAML\SAML2\HTTPRedirect();
    $binding->send($request);
```

License
-------

[](#license)

This library is licensed under the LGPL license version 2.1. For more details see [LICENSE](https://raw.github.com/simplesamlphp/saml2/master/LICENSE).

###  Health Score

67

—

FairBetter than 100% of packages

Maintenance87

Actively maintained with recent releases

Popularity40

Moderate usage in the ecosystem

Community25

Small or concentrated contributor base

Maturity97

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~25 days

Total

180

Last Release

66d ago

Major Versions

v4.18.1 → v5.0.0-alpha.212025-03-26

v4.19.0 → v5.0.32025-09-09

v5.0.4 → v6.0.02025-11-20

v4.19.1 → v5.0.52025-12-08

v5.0.5 → v6.1.02026-02-19

PHP version history (9 changes)v0.1.0-alphaPHP &gt;=5.3.3

v3.1.0PHP &gt;=5.4

v3.4.0PHP &gt;=7.2

v4.1.8PHP &gt;=7.1

v4.2.2PHP &gt;=7.1 || ^8.0

v5.0.0-alpha.1PHP ^8.0

v5.0.0-alpha.14PHP ^8.1

v6.0.0PHP ^8.2

v6.1.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/d424231c85138609ae230ccd5002c8025fd5dce7f51b2f1778f69ba3a49a4efa?d=identicon)[tvdijen](/maintainers/tvdijen)

---

Top Contributors

[![olavmrk](https://avatars.githubusercontent.com/u/349658?v=4)](https://github.com/olavmrk "olavmrk (1673 commits)")[![andreassolberg](https://avatars.githubusercontent.com/u/101361?v=4)](https://github.com/andreassolberg "andreassolberg (1099 commits)")[![tvdijen](https://avatars.githubusercontent.com/u/841045?v=4)](https://github.com/tvdijen "tvdijen (861 commits)")[![jaimeperez](https://avatars.githubusercontent.com/u/1942728?v=4)](https://github.com/jaimeperez "jaimeperez (185 commits)")[![thijskh](https://avatars.githubusercontent.com/u/3808792?v=4)](https://github.com/thijskh "thijskh (150 commits)")[![lon](https://avatars.githubusercontent.com/u/462659?v=4)](https://github.com/lon "lon (36 commits)")[![soyunalavadora](https://avatars.githubusercontent.com/u/133754?v=4)](https://github.com/soyunalavadora "soyunalavadora (18 commits)")[![cb8](https://avatars.githubusercontent.com/u/10119913?v=4)](https://github.com/cb8 "cb8 (17 commits)")[![trejjam](https://avatars.githubusercontent.com/u/3594540?v=4)](https://github.com/trejjam "trejjam (6 commits)")[![br00k](https://avatars.githubusercontent.com/u/2971381?v=4)](https://github.com/br00k "br00k (6 commits)")[![DRvanR](https://avatars.githubusercontent.com/u/1422284?v=4)](https://github.com/DRvanR "DRvanR (6 commits)")[![MKodde](https://avatars.githubusercontent.com/u/28252948?v=4)](https://github.com/MKodde "MKodde (6 commits)")[![tbenr](https://avatars.githubusercontent.com/u/15999009?v=4)](https://github.com/tbenr "tbenr (5 commits)")[![ghalse](https://avatars.githubusercontent.com/u/7996633?v=4)](https://github.com/ghalse "ghalse (4 commits)")[![olavmo-sikt](https://avatars.githubusercontent.com/u/98447575?v=4)](https://github.com/olavmo-sikt "olavmo-sikt (4 commits)")[![bjorpe](https://avatars.githubusercontent.com/u/10811673?v=4)](https://github.com/bjorpe "bjorpe (4 commits)")[![jas4711](https://avatars.githubusercontent.com/u/531817?v=4)](https://github.com/jas4711 "jas4711 (2 commits)")[![relaxnow](https://avatars.githubusercontent.com/u/524386?v=4)](https://github.com/relaxnow "relaxnow (2 commits)")[![timwienk](https://avatars.githubusercontent.com/u/150598?v=4)](https://github.com/timwienk "timwienk (2 commits)")[![brianV](https://avatars.githubusercontent.com/u/272424?v=4)](https://github.com/brianV "brianV (2 commits)")

### Embed Badge

![Health badge](/badges/simplesamlphp-saml2-legacy/health.svg)

```
[![Health](https://phpackages.com/badges/simplesamlphp-saml2-legacy/health.svg)](https://phpackages.com/packages/simplesamlphp-saml2-legacy)
```

###  Alternatives

[simplesamlphp/saml2

SAML2 PHP library from SimpleSAMLphp

30317.2M40](/packages/simplesamlphp-saml2)[simplesamlphp/simplesamlphp

A PHP implementation of a SAML 2.0 service provider and identity provider.

1.1k12.4M193](/packages/simplesamlphp-simplesamlphp)[google/auth

Google Auth Library for PHP

1.4k272.7M162](/packages/google-auth)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[web-auth/webauthn-lib

FIDO2/Webauthn Support For PHP

1225.3M72](/packages/web-auth-webauthn-lib)[litesaml/lightsaml

SAML 2.0 PHP library

1055.5M18](/packages/litesaml-lightsaml)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
