PHPackages                             helsingborg-stad/sso-saml - 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. helsingborg-stad/sso-saml

ActiveWordpress-plugin

helsingborg-stad/sso-saml
=========================

SAML SSO solution for Wordpress

v1.0.2(5y ago)054[2 PRs](https://github.com/helsingborg-stad/saml-sso/pulls)MITPHPCI passing

Since Oct 20Pushed 5mo ago7 watchersCompare

[ Source](https://github.com/helsingborg-stad/saml-sso)[ Packagist](https://packagist.org/packages/helsingborg-stad/sso-saml)[ RSS](/packages/helsingborg-stad-sso-saml/feed)WikiDiscussions master Synced today

READMEChangelog (3)Dependencies (1)Versions (8)Used By (0)

[![Contributors](https://camo.githubusercontent.com/491460cb35ef8f5f1183d12a9b1abd9fa134df72f8fbd6966bc0be04073ca4a0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636f6e7472696275746f72732f68656c73696e67626f72672d737461642f73616d6c2d73736f2e7376673f7374796c653d666c61742d737175617265)](https://github.com/helsingborg-stad/saml-sso/graphs/contributors)[![Forks](https://camo.githubusercontent.com/c91cf9bc640928ae4c33d3695a1ff08fcdcba3c8c4f41786128f9b1378c85f4c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f68656c73696e67626f72672d737461642f73616d6c2d73736f2e7376673f7374796c653d666c61742d737175617265)](https://github.com/helsingborg-stad/saml-sso/network/members)[![Stargazers](https://camo.githubusercontent.com/44660287c746aff684e26e7eee606fb75a0ccc4c6ee58c3141da25e949c26095/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f68656c73696e67626f72672d737461642f73616d6c2d73736f2e7376673f7374796c653d666c61742d737175617265)](https://github.com/helsingborg-stad/saml-sso/stargazers)[![Issues](https://camo.githubusercontent.com/fa07ca46bfa8b16475bfb61ddff0adf6d23f601606c3f5b5009629aef19b271f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f68656c73696e67626f72672d737461642f73616d6c2d73736f2e7376673f7374796c653d666c61742d737175617265)](https://github.com/helsingborg-stad/saml-sso/issues)[![License](https://camo.githubusercontent.com/76a4562f55dc8b5376eddcc670c31d1de01b54cd294c9fbc4d153e131a67561a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f68656c73696e67626f72672d737461642f73616d6c2d73736f2e7376673f7374796c653d666c61742d737175617265)](https://raw.githubusercontent.com/helsingborg-stad/saml-sso/master/LICENSE)

 [ ![Logo](images/logo.jpg) ](https://github.com/helsingborg-stad/dev-guide)

### SAML SSO

[](#saml-sso)

 SAML SSO plugin for Wordpress
 [Report Bug](https://github.com/helsingborg-stad/dev-guide/issues) · [Request Feature](https://github.com/helsingborg-stad/dev-guide/issues)

Table of Contents
-----------------

[](#table-of-contents)

- [Table of Contents](#table-of-contents)
- [About SAML SSO](#about-saml-sso)
    - [Built With](#built-with)
- [Getting Started](#getting-started)
    - [Prerequisites](#prerequisites)
    - [Installation](#installation)
    - [Configuration](#configuration)
        - [Required PHP-SAML Constants](#required-php-saml-constants)
        - [Optional PHP-SAML Constants](#optional-php-saml-constants)
        - [Additional PHP-SAML settings.](#additional-php-saml-settings)
        - [Other constants](#other-constants)
- [Usage](#usage)
- [Roadmap](#roadmap)
- [Contributing](#contributing)
- [License](#license)
- [Acknowledgements](#acknowledgements)

About SAML SSO
--------------

[](#about-saml-sso)

SAML SSO login plugin for wordpress. This plugin will add 3 endpoints required for SAML SSO to operate.

```
/saml/acs
/saml/logout
/saml/metadata

```

NOTE: Currently only invokable programatically se [usage](#usage) for instructions.

### Built With

[](#built-with)

- [Onelogin PHP SAML](https://github.com/onelogin/php-saml/)

Getting Started
---------------

[](#getting-started)

To get a local copy up and running follow these steps.

### Prerequisites

[](#prerequisites)

- Composer
    [Install instructions](https://getcomposer.org/download/)

### Installation

[](#installation)

1. Clone the repo

```
git clone https://github.com/helsingborg-stad/saml-sso.git
```

2. Install Composer packages

```
composer install
```

### Configuration

[](#configuration)

Configuration is done with constants in `wp-config.php`
PHP-SAML constants is in direct relation to settings the [PHP-SAML](https://github.com/onelogin/php-saml/) require.
Check documentation in PHP SAML for more information about these settings.

Example configuration:

```
// NOTE Never place certificates below the root web folder!
$idpCertificateFile = '/etc/certs/idp-cert.cer';
$spCertificateFile = '/etc/certs/sp-cert.cer';
$spCertificateKeyFile = '/etc/certs/sp-cert.key';

define('SAML_SP_ENITITY_ID', 'https://www.example.com/saml/metadata');
define('SAML_SP_ACS_URL', 'https://www.example.com/saml/acs');
define('SAML_IDP_ENTITY_ID', 'https://www.example.com/adfs/services/trust');
define('SAML_IDP_SSO_URL', 'https://www.example.com/adfs/ls/');
define('SAML_IDP_SLS_URL', 'https://www.example.com/adfs/ls/');

if (file_exists($idpCertificateFile)) {
    define('SAML_IDP_CERTIFICATE', file_get_contents($idpCertificateFile));
}

if (file_exists($spCertificateFile)) {
    define('SAML_SP_CERTIFICATE', file_get_contents($spCertificateFile));
}

if (file_exists($spCertificateKeyFile)) {
    define('SAML_SP_CERTIFICATE_KEY', file_get_contents($spCertificateKeyFile));
}

```

#### Required PHP-SAML Constants

[](#required-php-saml-constants)

The below constants is required to be set in your `wp-config.php` file.

```
SAML_SP_ENITITY_ID
SAML_SP_ACS_URL
SAML_SP_CERTIFICATE
SAML_SP_CERTIFICATE_KEY
SAML_IDP_ENTITY_ID
SAML_IDP_SSO_URL
SAML_IDP_SLS_URL

```

#### Optional PHP-SAML Constants

[](#optional-php-saml-constants)

Optional constants and their default value to be set in your `wp-config.php` file.

```
SAML_STRICT => true
SAML_DEBUG => false
SAML_SP_ACS_BINDING => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST',
SAML_SP_NAME_ID_FORMAT => 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress',
SAML_IDP_SSO_BINDING => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect',
SAML_IDP_SLS_BINDING => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect',
SAML_IDP_CERTIFICATE => null,
SAML_SECURITY_REQUESTED_AUTHN_CONTEXT => false,
SAML_SECURITY_SIGNATURE_ALGORITHM' => 'http://www.w3.org/2001/04/xmlenc#sha256',
SAML_SECURITY_DIGEST_ALGORITHM' => 'http://www.w3.org/2001/04/xmlenc#sha256',
SAML_SECURITY_LOWERCASE_URL_ENCODING => true,

```

#### Additional PHP-SAML settings.

[](#additional-php-saml-settings)

Additional PHP-SAML settings can be added with the `saml-sso-settings` filter.

#### Other constants

[](#other-constants)

Two constants is present for mapping configuration.
Overwrite this with constants `SAML_ATTRIBUTES_MAPPING` and `SAML_AD_GROUP_ROLE_MAPPING` in `wp-config-php`.

Default values:

```
SAML_ATTRIBUTES_MAPPING = [
    'username' => 'http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname',
    'first-name' => 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname',
    'last-name' => 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname',
    'email' => 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress',
    'ad-groups' => 'http://schemas.xmlsoap.org/claims/Group',
];

SAML_MAP_TO_AD_GROUP = true;

SAML_AD_GROUP_ROLE_MAPPING = [
    'Domain Users' => 'subscriber',
    'Domain Admins' => 'administrator'
];
```

Usage
-----

[](#usage)

When configured and plugin is activated, the code below can be used to trigger a SAML SSO login.

```
if (class_exists('\SAMLSSO\Client')) {
    $client = new \SAMLSSO\Client();
    // Supply where to redirect after login.
    $client->authenticate('https://www.example.com/redirect');
}
```

Roadmap
-------

[](#roadmap)

See the [open issues](https://github.com/helsingborg-stad/saml-sso/issues) for a list of proposed features (and known issues).

Contributing
------------

[](#contributing)

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.

1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

License
-------

[](#license)

Distributed under the [MIT License](https://raw.githubusercontent.com/helsingborg-stad/saml-sso/master/LICENSE).

Acknowledgements
----------------

[](#acknowledgements)

- [othneildrew Best README Template](https://github.com/othneildrew/Best-README-Template)

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance50

Moderate activity, may be stable

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

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

Total

3

Last Release

2019d ago

### Community

Maintainers

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

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/helsingborg-stad-sso-saml/health.svg)

```
[![Health](https://phpackages.com/badges/helsingborg-stad-sso-saml/health.svg)](https://phpackages.com/packages/helsingborg-stad-sso-saml)
```

###  Alternatives

[aacotroneo/laravel-saml2

A Laravel package for Saml2 integration as a SP (service provider) for multiple IdPs, based on OneLogin toolkit which is much more lightweight than simplesamlphp.

5704.4M](/packages/aacotroneo-laravel-saml2)[kimai/kimai

Kimai - Time Tracking

4.6k7.4k1](/packages/kimai-kimai)[hslavich/oneloginsaml-bundle

OneLogin SAML Bundle for Symfony

1482.5M1](/packages/hslavich-oneloginsaml-bundle)[pantheon-systems/wp-saml-auth

SAML authentication for WordPress, using SimpleSAMLphp.

93268.2k2](/packages/pantheon-systems-wp-saml-auth)[humanmade/wp-simple-saml

WordPress Simple SAML plugin

124284.7k2](/packages/humanmade-wp-simple-saml)[scaler-tech/laravel-saml2

SAML2 Service Provider integration for Laravel applications, based on OneLogin toolkit

2737.5k](/packages/scaler-tech-laravel-saml2)

PHPackages © 2026

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