PHPackages                             niif/simplesamlphp-module-attributescope - 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. [Search &amp; Filtering](/categories/search)
4. /
5. niif/simplesamlphp-module-attributescope

ActiveSimplesamlphp-module[Search &amp; Filtering](/categories/search)

niif/simplesamlphp-module-attributescope
========================================

Filter to remove attribute values which are not properly scoped.

v1.0.3(8y ago)11.4k4[1 issues](https://github.com/NIIF/simplesamlphp-module-attributescope/issues)[2 PRs](https://github.com/NIIF/simplesamlphp-module-attributescope/pulls)PHP

Since Nov 12Pushed 2y ago6 watchersCompare

[ Source](https://github.com/NIIF/simplesamlphp-module-attributescope)[ Packagist](https://packagist.org/packages/niif/simplesamlphp-module-attributescope)[ RSS](/packages/niif-simplesamlphp-module-attributescope/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (2)Dependencies (3)Versions (5)Used By (0)

Attributescope filter module
============================

[](#attributescope-filter-module)

[![Build Status](https://camo.githubusercontent.com/5c9ac32096c99249724888103584971646df354091c24f3e03d38e0bd712714a/68747470733a2f2f7472617669732d63692e6f72672f4e4949462f73696d706c6573616d6c7068702d6d6f64756c652d61747472696275746573636f70652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/NIIF/simplesamlphp-module-attributescope)

This module ensures that scoped attributes (such as eduPersonPrincipalName) have the right scopes defined in the entity metadata.

It removes values

- that should be scoped (see `attributesWithScope` below) but are not;
- whose scope does not match [shibmd:Scope](https://wiki.shibboleth.net/confluence/display/SC/ShibMetaExt+V1.0) element in the metadata.

Additionally, it is also capable to handle 'scope attributes' such as *schacHomeOrganization* that should be equivalent to `shibmd:Scope` element in the metadata.

Notes and limitations
---------------------

[](#notes-and-limitations)

- Regular expressions in `shibmd:Scope` are not supported.
- It is recommended to run this filter after *oid2name*. Please note that attribute names in the module configuration are case sensitive and must match the names in attributemaps.
- 'scope Attributes' must be singled valued, otherwise they are removed.
- Specifying an attribute in multiple configuration options is likely a user configuration issue. A value will only pass if it conforms to the validation rule for each configured option.

Installing the module
---------------------

[](#installing-the-module)

You can install the module with composer:

```
composer require niif/simplesamlphp-module-attributescope

```

Example configuration
---------------------

[](#example-configuration)

*config/config.php*

```
   authproc.sp = array(
       ...
        // 49 => array('class' => 'core:AttributeMap', 'oid2name'),
        // Verify scoped attributes with the metadata:
        50 => array(
            'class' => 'attributescope:FilterAttributes',
            // Default attributes with scope attributes.
            // 'attributesWithScope' => array('eduPersonPrincipalName', 'eduPersonScopedAffiliation'),
            // Default scopeAttribute
            // 'scopeAttributes' => array('schacHomeOrganization'),
       ),

```

Configurations Options
----------------------

[](#configurations-options)

- `attributesWithScope` an array of attributes that should be scoped and should match the scope from the metadata
- `attributesWithScopeSuffix` an array of attributes that have the scope as a suffix. For example, `user@department.example.com`and `department.example.com` are both suffixed with `example.com`. Useful when an SP is reliant on `mail` attribute to identify users and the IdP users various subdomains for mail.
- `scopeAttributes` an array of attributes that should exactly match the scope from the metadata
- `ignoreCheckForEntities` an array of IdP entity IDs to skip scope checking for. Useful when an IdP is a SAML proxy and is trusted to assert any scope.
- `ignoreCase` ignore the case of the scoped attribute. The new 'Subject Identifier Attributes' profile stipulates that comparison should be case insensitive. Default is false, for backwards compatability.

Development
===========

[](#development)

Runing tests
------------

[](#runing-tests)

```
./vendor/phpunit/phpunit/phpunit

```

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Total

4

Last Release

2925d ago

### Community

Maintainers

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

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

![](https://www.gravatar.com/avatar/58cf0b44aa083da212f27d6c89a3ba7b0716079d39f2d2d845d4997d61e93571?d=identicon)[northway](/maintainers/northway)

---

Top Contributors

[![pradtke](https://avatars.githubusercontent.com/u/932934?v=4)](https://github.com/pradtke "pradtke (9 commits)")[![szabogyula](https://avatars.githubusercontent.com/u/3406217?v=4)](https://github.com/szabogyula "szabogyula (4 commits)")[![bajnokk](https://avatars.githubusercontent.com/u/9942990?v=4)](https://github.com/bajnokk "bajnokk (3 commits)")[![sitya](https://avatars.githubusercontent.com/u/1099191?v=4)](https://github.com/sitya "sitya (3 commits)")

---

Tags

filtermodulesimplesamlphpscopesp

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[clue/stream-filter

A simple and modern approach to stream filtering in PHP

1.7k276.5M9](/packages/clue-stream-filter)[simplesamlphp/simplesamlphp

A PHP implementation of a SAML 2.0 service provider and identity provider.

1.1k13.0M216](/packages/simplesamlphp-simplesamlphp)[laminas/laminas-filter

Programmatically filter and normalize data and files

9530.3M177](/packages/laminas-laminas-filter)

PHPackages © 2026

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