Skip to content

SSP Auth processor that simplifies changing the scope on attributes.

Notifications You must be signed in to change notification settings

cirrusidentity/simplesamlphp-module-scoperewrite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

SSP Auth processor that simplifies changing the scope on attributes.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages