PHPackages                             drupalauth/simplesamlphp-module-drupalauth - 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. drupalauth/simplesamlphp-module-drupalauth

ActiveSimplesamlphp-module[Authentication &amp; Authorization](/categories/authentication)

drupalauth/simplesamlphp-module-drupalauth
==========================================

A SimpleSAMLphp module adding support for Drupal as the authentication source.

2.10.0(11mo ago)25305.4k—6.9%39[1 issues](https://github.com/drupalauth/simplesamlphp-module-drupalauth/issues)[2 PRs](https://github.com/drupalauth/simplesamlphp-module-drupalauth/pulls)1LGPL-2.1PHPPHP ^8.0

Since Sep 10Pushed 11mo ago5 watchersCompare

[ Source](https://github.com/drupalauth/simplesamlphp-module-drupalauth)[ Packagist](https://packagist.org/packages/drupalauth/simplesamlphp-module-drupalauth)[ Docs](https://github.com/drupalauth/simplesamlphp-module-drupalauth)[ RSS](/packages/drupalauth-simplesamlphp-module-drupalauth/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (17)Used By (1)

Introduction
------------

[](#introduction)

[![Build Status](https://camo.githubusercontent.com/c73a9908d90f56fe7bc02faa892ab6ba5a6f08e1fc29089783988e772ed1e33f/68747470733a2f2f6170702e7472617669732d63692e636f6d2f64727570616c617574682f73696d706c6573616d6c7068702d6d6f64756c652d64727570616c617574682e7376673f6272616e63683d6d61696e)](https://app.travis-ci.com/drupalauth/simplesamlphp-module-drupalauth)

Drupal + SimpleSAMLphp + drupalauth = Complete SAML Identity Provider (IdP)

Users interact with Drupal to create accounts, manage accounts, and authenticate. SAML SPs interact with [SimpleSAMLphp](https://simplesamlphp.org/). Drupalauth ties Drupal to SimpleSAMLphp.

The drupalauth module for simpleSAMLphp makes it easy to create a SAML or Shibboleth identity provider (IdP) by enabling authentication of users against a Drupal site on the same server. This allows the administrator to leverage the user management and integration capabilities of [Drupal](http://drupal.org) for managing the identity life cycle.

**NOTE:** This is software establishes a SAML identity provider (IdP) using Drupal as the user database instead of LDAP. If you want to establish your Drupal site as a SAML service provider (SP) connected to a SAML or Shibboleth IdP, see the [simplesamlphp\_auth](https://www.drupal.org/project/simplesamlphp_auth) module for Drupal.

### simpleSAMLphp module

[](#simplesamlphp-module)

This module for SimpleSAMLphp provides an Authentication Source for authenticating users against a local Drupal site. This allows the administrator to leverage the user management and integration capabilities of Drupal for managing the identity life cycle and the power of SimpleSAMLphp for identity integration. This is a simpleSAMLphp module, NOT a Drupal module. Download this module only if you want to use Drupal as Identity Provider.

### Drupal modules

[](#drupal-modules)

If you want to use Drupal as Identity Provide you should also install [drupalauth4ssp](https://www.drupal.org/project/drupalauth4ssp) that is available on Drupal.org. Please note that all issues related to Drupal functionality should be reported there.

If you want to connect your Drupal site as Service Provider to a SAML or Shibboleth IdP, use the [simplesamlphp\_auth](http://drupal.org/project/simplesamlphp_auth) module for Drupal.

Branch and version naming
-------------------------

[](#branch-and-version-naming)

Following [Semantic Versioning](https://semver.org/) is hard when you have multiple upstream dependencies.

So in a X.Y.Z version:

- X - major SimpleSAMLphp version
- Y - major Drupal version
- Z - inthis module incremental version

Example: for SimpleSAMLphp version 1.15.4 with Drupal version 8.5.6 and this module version 1 we will have tag 1.8.1. Same thing for Drupal 7 will be 1.7.1.

`main` at the moment corresponds to `2.10.*`. Branch `1.7` is respectfully for Drupal 7 (no Composer integration).

Note on Drupal configuration
----------------------------

[](#note-on-drupal-configuration)

Disabling `discovery` cache will prevent this module from functioning.

See this issue [\#71](https://github.com/drupalauth/simplesamlphp-module-drupalauth/issues/71), specifically [this comment](https://github.com/drupalauth/simplesamlphp-module-drupalauth/issues/71#issuecomment-815725363).

Installation
------------

[](#installation)

### Requirements

[](#requirements)

1. Install Drupal 10.x
2. Install simpleSAMLphp
3. Install drupalauth - `composer require drupalauth/simplesamlphp-module-drupalauth`
4. Configure SimpleSAMLphp to use something other than `phpsession` for session storage, e.g., SQL or memcache (See: `store.type` in `simplesamlphp/config/config.php`).
5. Configure the authentication source in `simplesamlphp/config/authsources.php` as described below.

#### Authenticate against Drupal but use the SimpleSAMLphp login page

[](#authenticate-against-drupal-but-use-the-simplesamlphp-login-page)

The advantage of this approach is that there is no obvious connection between SimpleSAMLphp IdP and the Drupal site.

**Details**

Configure the authentication source by putting following code into `simplesamlphp/config/authsources.php`

```
'drupal-userpass' => array(
    'drupalauth:UserPass',

    // The filesystem path of the Drupal directory.
    'drupalroot' => '/var/www/drupal',

    // Whether to turn on debug
    'debug' => true,

    // Which attributes should be retrieved from the Drupal site.
   'attributes' => array(
       array('field_name' => 'uid', 'attribute_name' => 'uid'),
       array('field_name' => 'roles', 'attribute_name' => 'roles', 'field_property' => 'target_id'),
       array('field_name' => 'name', 'attribute_name' => 'cn'),
       array('field_name' => 'mail', 'attribute_name' => 'mail'),
       array('field_name' => 'field_first_name', 'attribute_name' => 'givenName'),
       array('field_name' => 'field_last_name', 'attribute_name' => 'sn'),
       array('field_name' => 'field_organization', 'attribute_name' => 'ou', 'field_property' => 'target_id'),
   ),
),
```

Leave 'attributes' empty or unset to get all available field values. Attribute names in this case would be "$field\_name:$property\_name".

#### Authenticate against Drupal but use the Drupal login page

[](#authenticate-against-drupal-but-use-the-drupal-login-page)

The advantage of this approach is that the SimpleSAMLphp IdP session is tied to a Drupal session. This allows the user who is already logged into the Drupal site to then navigate to a SAML SP that uses the IdP without the need to authenticate again.

**Details**

Configure the authentication source by putting following code into `simplesamlphp/config/authsources.php`

```
'drupal-userpass' => array('drupalauth:External',

 // The filesystem path of the Drupal directory.
 'drupalroot' => '/var/www/drupal',

 // Whether to turn on debug
 'debug' => true,

 // the URL of the Drupal logout page
 'drupal_logout_url' => 'https://www.example.com/drupal/user/logout',

 // the URL of the Drupal login page
 'drupal_login_url' => 'https://www.example.com/drupal/user/login',

 // Which attributes should be retrieved from the Drupal site.
    'attributes' => array(
        array('field_name' => 'uid', 'attribute_name' => 'uid'),
        array('field_name' => 'roles', 'attribute_name' => 'roles', 'field_property' => 'target_id'),
        array('field_name' => 'name', 'attribute_name' => 'cn'),
        array('field_name' => 'mail', 'attribute_name' => 'mail'),
        array('field_name' => 'field_first_name', 'attribute_name' => 'givenName'),
        array('field_name' => 'field_last_name', 'attribute_name' => 'sn'),
        array('field_name' => 'field_organization', 'attribute_name' => 'ou', 'field_property' => 'target_id'),
    ),
),
```

###  Health Score

54

—

FairBetter than 97% of packages

Maintenance51

Moderate activity, may be stable

Popularity48

Moderate usage in the ecosystem

Community26

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 71.3% 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 ~164 days

Recently: every ~146 days

Total

16

Last Release

337d ago

Major Versions

1.9.x-dev → 2.10.0-rc.12023-11-07

1.7.x-dev → 2.7.x-dev2024-04-22

PHP version history (3 changes)1.8.1PHP ^5.6.0|^7.0

1.9.1PHP ^5.6.0|^7.0|^8.0

2.10.0-rc.1PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/2c22b9b9797f0d8455fa6dd13e6c04573e55276c85c9a214456fae7c0f901d86?d=identicon)[RoSk0](/maintainers/RoSk0)

---

Top Contributors

[![RoSk0](https://avatars.githubusercontent.com/u/119257?v=4)](https://github.com/RoSk0 "RoSk0 (82 commits)")[![alexschedrov](https://avatars.githubusercontent.com/u/1316234?v=4)](https://github.com/alexschedrov "alexschedrov (17 commits)")[![sergiuteaca](https://avatars.githubusercontent.com/u/7046893?v=4)](https://github.com/sergiuteaca "sergiuteaca (5 commits)")[![rmuit](https://avatars.githubusercontent.com/u/153133?v=4)](https://github.com/rmuit "rmuit (2 commits)")[![daggerhart](https://avatars.githubusercontent.com/u/1205329?v=4)](https://github.com/daggerhart "daggerhart (2 commits)")[![longwave](https://avatars.githubusercontent.com/u/197817?v=4)](https://github.com/longwave "longwave (2 commits)")[![patrickharriscatalyst](https://avatars.githubusercontent.com/u/81277854?v=4)](https://github.com/patrickharriscatalyst "patrickharriscatalyst (1 commits)")[![dkosbob](https://avatars.githubusercontent.com/u/14320048?v=4)](https://github.com/dkosbob "dkosbob (1 commits)")[![cato-cit](https://avatars.githubusercontent.com/u/8109414?v=4)](https://github.com/cato-cit "cato-cit (1 commits)")[![galooph](https://avatars.githubusercontent.com/u/37407?v=4)](https://github.com/galooph "galooph (1 commits)")[![jdleonard](https://avatars.githubusercontent.com/u/2074112?v=4)](https://github.com/jdleonard "jdleonard (1 commits)")

---

Tags

drupalidentity-provideridpsimplesamlphpsimplesamlphp-idpsimplesamlphp-moduleAuthenticationdrupalsimplesamlphp

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/drupalauth-simplesamlphp-module-drupalauth/health.svg)

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

PHPackages © 2026

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