PHPackages                             ym-careers/saml2 - 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. ym-careers/saml2

ActiveLibrary

ym-careers/saml2
================

SAML2 PHP library from SimpleSAMLphp

v2.0.0(3y ago)013.3k↓33.3%11LGPL-2.1PHPPHP &gt;=5.4

Since May 9Pushed 3y ago2 watchersCompare

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

READMEChangelogDependencies (8)Versions (4)Used By (1)

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

[](#simplesamlphp-saml2-library)

[![Build Status](https://camo.githubusercontent.com/cb5374bb886a563b96090e90423a4e5dd1f5a060f4c00baf776edee12b82fd8c/68747470733a2f2f7472617669732d63692e6f72672f73696d706c6573616d6c7068702f73616d6c322e706e673f6272616e63683d666561747572652f6669782d6275696c64)](https://travis-ci.org/simplesamlphp/saml2) [![Coverage Status](https://camo.githubusercontent.com/65abf5f264d57455f0b1cbf389e13a9dd34fc77c690e59430e8f30e230f9086a/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f73696d706c6573616d6c7068702f73616d6c322e737667)](https://coveralls.io/r/simplesamlphp/saml2)

A PHP library for SAML2 related functionality. Extracted from [SimpleSAMLphp](https://www.simplesamlphp.org), used by [OpenConext](https://www.openconext.org). This library started as a collaboration between [UNINETT](https://www.uninett.no) and [SURFnet](https://www.surfnet.nl) but everyone is invited to contribute.

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 (`3.x` range) is the *only supported version*.

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

Usage
-----

[](#usage)

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

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

- Provide the required external dependencies by extending and implementing the `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';
    SAML2\Compat\ContainerSingleton::setContainer($container);

    // Set up an AuthnRequest
    $request = new SAML2\AuthnRequest();
    $request->setId($container->generateId());
    $request->setIssuer('https://sp.example.edu');
    $request->setDestination('https://idp.example.edu');

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

Security
--------

[](#security)

- Should you need to create a DOMDocument instance, use the `SAML2\DOMDocumentFactory` to create DOMDocuments from either a string (`SAML2\DOMDocumentFactory::fromString($theXmlAsString)`), a file (`SAML2\DOMDocumentFactory::fromFile($pathToTheFile)`) or just a new instance (`SAML2\DOMDocumentFactory::create()`). This in order to protect yourself against the [XXE Processing Vulnerability](https://www.owasp.org/index.php/XML_External_Entity_(XXE)_Processing), as well as [XML Entity Expansion](https://phpsecurity.readthedocs.org/en/latest/Injection-Attacks.html#defenses-against-xml-entity-expansion) attacks

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

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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 ~1569 days

Total

2

Last Release

1362d ago

Major Versions

v1.0.0 → v2.0.02022-08-26

### Community

Maintainers

![](https://www.gravatar.com/avatar/21a9085bf69c801ca025d7c503a1cbebe0269fd75f18d963d5b0ff2426d8e183?d=identicon)[dev.careers@yourmembership.com](/maintainers/dev.careers@yourmembership.com)

---

Top Contributors

[![ymcareers](https://avatars.githubusercontent.com/u/39136146?v=4)](https://github.com/ymcareers "ymcareers (2 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/ym-careers-saml2/health.svg)

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

###  Alternatives

[litesaml/lightsaml

SAML 2.0 PHP library

1055.5M18](/packages/litesaml-lightsaml)[elgg/elgg

Elgg is an award-winning social networking engine, delivering the building blocks that enable businesses, schools, universities and associations to create their own fully-featured social networks and applications.

1.7k15.7k5](/packages/elgg-elgg)[api-platform/metadata

API Resource-oriented metadata attributes and factories

243.5M96](/packages/api-platform-metadata)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)[flowwow/cloudpayments-php-client

cloudpayments api client

2188.2k](/packages/flowwow-cloudpayments-php-client)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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