PHPackages                             theodorejb/saml-utils - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. theodorejb/saml-utils

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

theodorejb/saml-utils
=====================

Utilities to streamline Light Saml usage

v1.2.0(1y ago)13.5k↓50%MITPHPPHP &gt;=8.1CI passing

Since Apr 24Pushed 9mo ago1 watchersCompare

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

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

SAML Utils
==========

[](#saml-utils)

This package provides a few helpful utilities on top of [Lite Saml](https://github.com/litesaml/lightsaml) to streamline common tasks.

Install via Composer
--------------------

[](#install-via-composer)

`composer require theodorejb/saml-utils`

Working with metadata
---------------------

[](#working-with-metadata)

The `SamlMetadata` class simplifies getting data from Identity Provider metadata. Call `SamlMetadata::fromXml($xml)` to create an instance from an Entity Descriptor XML string.

The underlying `EntityDescriptor` object can be accessed via a readonly `$entityDescriptor` property.

`SamlMetadata` implements the following methods:

### `getIdpCertificate()`

[](#getidpcertificate)

Returns an `X509Certificate` instance for the Identity Provider certificate.

### `getIdpSsoService()`

[](#getidpssoservice)

Returns the Redirect or POST `SingleSignOnService` defined by the Identity Provider for receiving a SAML request to initiate single sign-on.

### `getIdpLogoutService()`

[](#getidplogoutservice)

Returns the Redirect or POST `SingleLogoutService` defined by the Identity Provider.

Utility methods
---------------

[](#utility-methods)

The `SamlUtils` class implements the following static utility methods:

### `getRequestFromGlobals(): MessageContext`

[](#getrequestfromglobals-messagecontext)

Returns an object for the SAML request or response from the global GET/POST data.

### `getMessageHttpResponse(SamlMessage $message, string $bindingType): Response`

[](#getmessagehttpresponsesamlmessage-message-string-bindingtype-response)

Returns a `Symfony\Component\HttpFoundation\Response` instance for sending the SAML message.

### `validateSignature(SamlMessage $message, X509Certificate $certificate): void`

[](#validatesignaturesamlmessage-message-x509certificate-certificate-void)

Throws an Exception if the message signature is missing or fails verification with the certificate.

### `getSubjectNameId(SamlResponse $response): string`

[](#getsubjectnameidsamlresponse-response-string)

Returns the user identity being asserted by the identity provider.

### `getFirstAttributeStatement(SamlResponse $response): AttributeStatement|null`

[](#getfirstattributestatementsamlresponse-response-attributestatementnull)

Returns the first assertion attribute statement if one exists.

### `getAttributeStatementValue(AttributeStatement $statement, string $name): string`

[](#getattributestatementvalueattributestatement-statement-string-name-string)

Returns the assertion attribute value for the specified attribute name. Throws an exception if the attribute doesn't exist.

### `getResponseAttributeValue(SamlResponse $response, string $name): string`

[](#getresponseattributevaluesamlresponse-response-string-name-string)

Same as `getAttributeStatementValue()`, but can be used directly from a `SamlResponse` rather than an `AttributeStatement`.

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance48

Moderate activity, may be stable

Popularity23

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

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

Total

5

Last Release

586d ago

Major Versions

v0.2.0 → v1.0.02023-04-26

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3053271?v=4)[Theodore Brown](/maintainers/theodorejb)[@theodorejb](https://github.com/theodorejb)

---

Top Contributors

[![theodorejb](https://avatars.githubusercontent.com/u/3053271?v=4)](https://github.com/theodorejb "theodorejb (11 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/theodorejb-saml-utils/health.svg)

```
[![Health](https://phpackages.com/badges/theodorejb-saml-utils/health.svg)](https://phpackages.com/packages/theodorejb-saml-utils)
```

###  Alternatives

[vuestorefront/magento2-vue-cart-sync

Synchronize Magento cart between Vue Storefront

1958.5k](/packages/vuestorefront-magento2-vue-cart-sync)[inspiredminds/contao-glightbox

Contao extension to integrate GLightbox.

1223.3k1](/packages/inspiredminds-contao-glightbox)

PHPackages © 2026

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