ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
PersistentNameID2TargetedID.php
Go to the documentation of this file.
1<?php
2
3
10{
11
17 private $attribute;
18
19
25 private $nameId;
26
27
34 public function __construct($config, $reserved)
35 {
36 parent::__construct($config, $reserved);
37 assert(is_array($config));
38
39 if (isset($config['attribute'])) {
40 $this->attribute = (string) $config['attribute'];
41 } else {
42 $this->attribute = 'eduPersonTargetedID';
43 }
44
45 if (isset($config['nameId'])) {
46 $this->nameId = (bool) $config['nameId'];
47 } else {
48 $this->nameId = true;
49 }
50 }
51
52
58 public function process(&$state)
59 {
60 assert(is_array($state));
61
62 if (!isset($state['saml:NameID'][\SAML2\Constants::NAMEID_PERSISTENT])) {
64 'Unable to generate eduPersonTargetedID because no persistent NameID was available.'
65 );
66 return;
67 }
68
70 $nameID = $state['saml:NameID'][\SAML2\Constants::NAMEID_PERSISTENT];
71
72 $state['Attributes'][$this->attribute] = array((!$this->nameId) ? $nameID->value : $nameID);
73 }
74}
if(!array_key_exists('stateid', $_REQUEST)) $state
Handle linkback() response from LinkedIn.
Definition: linkback.php:10
An exception for terminatinating execution or to throw for unit testing.
const NAMEID_PERSISTENT
Persistent NameID format.
Definition: Constants.php:195
static warning($string)
Definition: Logger.php:177
process(&$request)
Process a request.
__construct($config, $reserved)
Initialize this filter, parse configuration.
$config
Definition: bootstrap.php:15