Skip to content

Latest commit

 

History

History
66 lines (47 loc) · 1.83 KB

File metadata and controls

66 lines (47 loc) · 1.83 KB

Overview

SSP module to simplify rewriting scoped attributes.

The module can move the old scope into the username portion, or replace it.

Usage

ScopeRewrite

In the below example if the user attributes were:

Then after processing it would look like

'authproc' => array(
   500 => array(
            'class' => 'scoperewrite:ScopeRewrite',
            'attributesOldScopeToUsername' => array('urn:oid:1.3.6.1.4.1.5923.1.1.1.6'), // eduPersonPrincipalName
            'attributesReplaceScope' => array('urn:oid:1.3.6.1.4.1.5923.1.1.1.9'), // eduPersonScopedAffiliation
            'newScope' => 'example.com',
            //'ignoreForScopes' => ['example.edu'] // for attributes with these scopes, do not rescope
            // Pick a old scope separator. Default is +
            // 'oldScopeSeparator' => '(at)'
         );

ScopeMap

Maps a set of scopes to new scopes.

'authproc' => array(
   500 => array(
            'class' => 'scoperewrite:ScopeMap',
            'scopeMap' => [
                'student.example.edu' => 'example.edu',
                'staff.example.edu' => 'example.edu',
                'DOMAIN.EDU' => 'domain.edu'
            ],
            'srcAttribute' => 'eppn',
            'destAttribute' => 'rescopedEppn',
         );

Installation

The module is not installed in packagist. You can add the repo.

composer config repositories.cirrus-scoperewrite git https://github.com/cirrusidentity/simplesamlphp-module-scoperewrite
composer require cirrusidentity/simplesamlphp-module-scoperewrite:dev-master

Development

  • Write tests. Run tests with phpunit. The phpunit.xml file already defines the location for the tests
  • Check PSR-2 style. phpcs --standard=PSR2 lib