Fork notice: This repository is a maintained fork of mimaen/simplesamlphp-module-attributes (
mimaen/simplesamlphp-module-hubandspoke, originally created by Miguel Macías Enguídanos, UPV), updated by the University of Córdoba (InformaticaUCO) for SimpleSAMLphp 2.5+ and PHP 8.2+ while preserving byte-for-byte compatibility with the originaleduPersonTargetedIDhash calculation.
mainbranch (v2.5.x): SimpleSAMLphp 2.5+ / PHP 8.2+ (informaticauco/simplesamlphp-module-hubandspoke).1.xbranch (v1.19.0): Legacy SimpleSAMLphp 1.x code (preserved as-is from upstream).
composer require informaticauco/simplesamlphp-module-hubandspoke:^2.5Enable the module in config/config.php:
'module.enable' => [
'hubandspoke' => true,
],A flexible way for generate one or more values for the eduPersonTargetedId attribute.
hubandspoke:TargetedID is an Authentication Processing Filter for SimpleSAMLphp, based on core:TargetedID by Olav Morken, UNINETT AS.
This filter generates one or more values for the eduPersonTargetedID attribute, using:
- an attribute identifying the authenticated user
- (optionally) a value identifying the SP requesting authentication
- (optionally) a value identifying the IdP
- (optionally) a fixed random value for salting the result
- a hash algorithm
Configuration allows:
- set alternative attributes (in order of preference) to identify the user
- set alternative attributes (in order of preference) to identify the target
- set alternative attributes (in order of preference) to identify the IdP
- transform the target identifier
- filter SP and/or users (send a value only for matching entities)
Read the docs to see all the options.
###Configuration samples
- eduPersonTargetedId with one unique standard value:
'authproc' => array(
50 => 'hubandspoke:TargetedID',
),sha256(userID + '@@' + targetID + '@@' + sourceID)
- eduPersonTargetedId obfuscated with a salt:
'authproc' => array(
50 => array(
'class' => 'hubandspoke:TargetedID',
'salt' => 'randomString',
),
),sha256(salt + '@@' + userID + '@@' + targetID + '@@' + sourceID + '@@' + salt)
- eduPersonTargetedId with a different formula:
'authproc' => array(
50 => array(
'class' => 'hubandspoke:TargetedID',
'userID' => 'Attributes/mail',
'fields' => array('salt', 'userID', 'targetID'),
'salt' => 'randomString',
),
),sha256(salt + '@@' + mail + '@@' + targetID)
- eduPersonTargetedId with two values:
'authproc' => array(
50 => array(
'class' => 'hubandspoke:TargetedID',
'salt' => 'randomString',
'values' => array(
'new' => array(
'fieldSeparator' => '//',
),
'old' => array(
'hashFunction' => 'md5',
'fields' => array('userID'),
),
),
),
),sha256(salt + '//' + userID + '//' + targetID + '//' + sourceID + '//' + salt)
md5(userID)
- eduPersonTargetedId with two values prefixed:
- one of them only for a specific SP (http://*.example.com)
- the other one for all SP, but considering the same SP all URL https://*.blogs.example.com (same eduPersonTargetedId)
'authproc' => array(
50 => array(
'class' => 'hubandspoke:TargetedID',
'salt' => 'randomString',
'values' => array(
'new' => array(
'prefix' => '{new}',
'targetTransform' => array(
'#^(https?://)[^./]+\.(blogs\.example\.com)(/|$).*$#' => '$1$2/',
),
),
'old' => array(
'prefix' => '{old}',
'hashFunction' => 'md5',
'userID' => array('Attributes/mail', 'UserID'),
'fields' => 'userID',
'ifTarget' => '#^https?://([^./]+\.)*example\.com(/|$)#',
),
),
),
),'{new}' + sha256(salt + '@@' + userID + '@@' + targetID* + '@@' + sourceID + '@@' + salt)
'{old}' + md5(userID) only for *.example.com