SmartAttributes module

The SmartAttributes module provides authentication processing filters to add attributes. The logic in this filter exceeds what is possible with the standard filters such, as [ core:AttributeAdd ], [ core:AttributeAlter ], and [ core:AttributeMap ].

smartattributes:SmartID

A filter to add an identifier attribute, based on the first non-empty attribute from a given list of attribute names. This is useful when there are multiple SAML IdPs configured, and there is no common identifier among them. For example some IdPs send eduPersonPrincipalName, while others send eduPersonTargetedID. If any of the social networks are configured as an authsource, they will send yet another identifier. The filter has the following configuration options:

The generated identifiers have the following form:

AttributeName:AttributeValue!AuthenticatingAuthority

For example:

eduPersonTargetedID:c4bcbe7ca8eac074f65291fd5524caa88f3115c8!https://login.terena.org/idp/saml2/idp/metadata.php

Examples

Without any configuration:

'authproc' => [
    50 => [
        'class' => 'smartattributes:SmartID'
    ],
],

This will add an attribute called smart_id with a value looking like, for example:

eduPersonTargetedID:c4bcbe7ca8eac074f65291fd5524caa88f3115c8!https://login.terena.org/idp/saml2/idp/metadata.php

Custom configuration:

'authproc' => [
    50 => [
        'class' => 'smartattributes:SmartID',
        'candidates' => ['eduPersonTargetedID', 'eduPersonPrincipalName'],
        'id_attribute' => 'FooUniversityLocalID',
        'add_authority' => FALSE,
    ],
],

This will add an attribute called FooUniversityLocalID with a value like:

eduPersonTargetedID:c4bcbe7ca8eac074f65291fd5524caa88f3115c8

If you also want to remove the name of the originating attribute, you could configure it like this:

'authproc' => [
    50 => [
        'class' => 'smartattributes:SmartID',
        'candidates' => ['eduPersonTargetedID', 'eduPersonPrincipalName'],
        'id_attribute' => 'FooUniversityLocalID',
        'add_authority' => FALSE,
        'add_candidate' => FALSE,
    ],
],

Resulting in:

c4bcbe7ca8eac074f65291fd5524caa88f3115c8