PHPackages                             ck-ws/zfc-shib - 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. ck-ws/zfc-shib

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

ck-ws/zfc-shib
==============

Shibboleth authentication for Laminas

2.0.0(4y ago)06BSD-3-ClausePHPPHP ^7.3

Since May 29Pushed 4y agoCompare

[ Source](https://github.com/ck-ws/ZfcShib)[ Packagist](https://packagist.org/packages/ck-ws/zfc-shib)[ Docs](https://github.com/ck-ws/ZfcShib)[ RSS](/packages/ck-ws-zfc-shib/feed)WikiDiscussions master Synced 1mo ago

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

Shibboleth authentication for Laminas
=====================================

[](#shibboleth-authentication-for-laminas)

The module provides Shibboleth authentication as a standard [Laminas](https://getlaminas.org/)authentication adapter.

Requirements
------------

[](#requirements)

- [Shibboleth SP](http://shibboleth.net/) instance - configured and running to provide user's attributes as environment variables to the target application

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

[](#installation)

The recommended installation method is through [composer](https://getcomposer.org/):

```
composer require ck-ws/zfc-shib "^2.0.0"

```

You can use this as a Laminas module in a Laminas MVC application or just as a library in any other type of application. If you want to use it as a module, add the module name 'ZfcShib' to your application configuration.

Basic usage
-----------

[](#basic-usage)

The adapter accepts these configuration options:

- `id_attr_name` (required) - the name of the attribute, which contains the user identity, for example `eppn`
- `user_attr_names` (optional) - a list of user attribute names to be extracted and added to the result user identity. If not specified, all default attributes will be added.
- `system_attr_names` (optional) - a list of system attribute names to be extracted and added to the result user identity (such as `Shib-Identity-Provider` for example). If not specified, all default attributes will be added.

Example:

```
    $adapter = new \ZfcShib\Authentication\Adapter\Shibboleth(array(
        'id_attr_name' => 'eppn',
        'user_attr_names' => array(
            'eppn',
            'cn',
            'mail'
        )
    ));

    $result = $adapter->authenticate();

    if ($result->isValid()) {
        $identity = $result->getIdentity();
    }
```

The `$identity` array then contains two sub-arrays:

- `system` - contains system attributes
- `user` - contains the required user attributes `eppn`, `cn` and `mail`.

The `$identity` variable will contain:

```
Array
(
    [system] => Array
    (
        [Shib-Application-ID] => default
        [Shib-Identity-Provider] => https://idp.example.org/idp/shibboleth
        [Shib-Authentication-Instant] => 2013-05-13T13:40:45.687Z
        [Shib-Authentication-Method] => urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport
        [Shib-AuthnContext-Class] => urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport
        [Shib-Session-Index] => cfe418967cd195e568ac000f57234bc287ecb5532365aa46c893d6e7f34300f0
    )

    [user] => Array
    (
        [eppn] => test@example.org
        [cn] => Test User
        [mail] => test.user@example.org
    )

)

```

Alternative identity container
------------------------------

[](#alternative-identity-container)

By default, the identity is returned as an array. But you can make the adapter return the identity in a format that suits you best. If you pass an identity factory object as a third parameter of the adapter's contructor, it will be used to create the identity. The factory must implement the `ZfcShib\Authentication\Identity\IdentityFactoryInterface` with the `createIdentity()` method, which receives the identity data value object as an argument and should return the resulting identity.

```
    use ZfcShib\Authentication\Identity;

    class MyIdentityFactory implements IdentityFactoryInterface
    {

        public function createIdentity(Identity\Data $identityData)
        {
            return new MyUser($identityData->getUserData());
        }
    }

    $identityFactory = new MyIdentityFactory();
    $adapter = new \ZfcShib\Authentication\Adapter\Shibboleth($options, null, $identityFactory);
```

Dummy adapter
-------------

[](#dummy-adapter)

If you need to develop and test your application and you don't have a running Shibboleth SP available, you can use the `ZfcShib\Authentication\Adapter\Dummy` adapter, which simulates the functionality of the Shibboleth adapter. Just pass all dummy user and system data to the constructor and use the adapter instead of the "real" one:

```
    use ZfcShib\Authentication\Adapter;

    $dummyOptions = array(
        'user_data' => array(
            'uid' => 'foo',
            'cn' => 'Foo Bar',
            'mail' => 'foo@bar.cz',
            'employeeNumber' => 123456
        ),
        'system_data' => array(
            'Shib-Application-ID' => 'default'
        )
    );

    $dummy = new Adapter\Dummy($dummyOptions, null, new MyUserFactory());
```

License
-------

[](#license)

- [BSD 3 Clause](https://opensource.org/licenses/BSD-3-Clause)

Links
-----

[](#links)

- [GitHub](https://github.com/ck-ws/ZfcShib)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 61.9% 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 ~1590 days

Total

3

Last Release

1549d ago

Major Versions

1.1.0 → 2.0.02022-02-11

PHP version history (2 changes)1.0.0PHP &gt;=5.3.3

2.0.0PHP ^7.3

### Community

Maintainers

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

---

Top Contributors

[![ivan-novakov](https://avatars.githubusercontent.com/u/1208505?v=4)](https://github.com/ivan-novakov "ivan-novakov (13 commits)")[![christophkreutzer](https://avatars.githubusercontent.com/u/26149233?v=4)](https://github.com/christophkreutzer "christophkreutzer (7 commits)")[![shuyg](https://avatars.githubusercontent.com/u/6391050?v=4)](https://github.com/shuyg "shuyg (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ck-ws-zfc-shib/health.svg)

```
[![Health](https://phpackages.com/badges/ck-ws-zfc-shib/health.svg)](https://phpackages.com/packages/ck-ws-zfc-shib)
```

###  Alternatives

[kokspflanze/bjy-authorize

Laminas\\Acl based firewall system for Laminas dispatch protection

20178.2k4](/packages/kokspflanze-bjy-authorize)

PHPackages © 2026

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