ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
sspmod_saml_Auth_Process_AttributeNameID Class Reference
+ Inheritance diagram for sspmod_saml_Auth_Process_AttributeNameID:
+ Collaboration diagram for sspmod_saml_Auth_Process_AttributeNameID:

Public Member Functions

 __construct ($config, $reserved)
 Initialize this filter, parse configuration. More...
 
- Public Member Functions inherited from sspmod_saml_BaseNameIDGenerator
 __construct ($config, $reserved)
 Initialize this filter, parse configuration. More...
 
 process (&$state)
 Generate transient NameID. More...
 
- Public Member Functions inherited from SimpleSAML_Auth_ProcessingFilter
 __construct (&$config, $reserved)
 Constructor for a processing filter. More...
 
 process (&$request)
 Process a request. More...
 

Protected Member Functions

 getValue (array &$state)
 Get the NameID value. More...
 
- Protected Member Functions inherited from sspmod_saml_BaseNameIDGenerator
 getValue (array &$state)
 Get the NameID value. More...
 

Private Attributes

 $attribute
 

Additional Inherited Members

- Data Fields inherited from SimpleSAML_Auth_ProcessingFilter
 $priority = 50
 Priority of this filter. More...
 
- Protected Attributes inherited from sspmod_saml_BaseNameIDGenerator
 $format
 

Detailed Description

Definition at line 9 of file AttributeNameID.php.

Constructor & Destructor Documentation

◆ __construct()

sspmod_saml_Auth_Process_AttributeNameID::__construct (   $config,
  $reserved 
)

Initialize this filter, parse configuration.

Parameters
array$configConfiguration information about this filter.
mixed$reservedFor future use.
Exceptions
SimpleSAML_Error_ExceptionIf the required options 'Format' or 'attribute' are missing.

Definition at line 28 of file AttributeNameID.php.

References $config.

29  {
30  parent::__construct($config, $reserved);
31  assert(is_array($config));
32 
33  if (!isset($config['Format'])) {
34  throw new SimpleSAML_Error_Exception("AttributeNameID: Missing required option 'Format'.");
35  }
36  $this->format = (string) $config['Format'];
37 
38  if (!isset($config['attribute'])) {
39  throw new SimpleSAML_Error_Exception("AttributeNameID: Missing required option 'attribute'.");
40  }
41  $this->attribute = (string) $config['attribute'];
42  }
$config
Definition: bootstrap.php:15

Member Function Documentation

◆ getValue()

sspmod_saml_Auth_Process_AttributeNameID::getValue ( array &  $state)
protected

Get the NameID value.

Parameters
array$stateThe state array.
Returns
string|null The NameID value.

Definition at line 51 of file AttributeNameID.php.

References SimpleSAML\Logger\warning().

52  {
53 
54  if (!isset($state['Attributes'][$this->attribute]) || count($state['Attributes'][$this->attribute]) === 0) {
56  'Missing attribute '.var_export($this->attribute, true).
57  ' on user - not generating attribute NameID.'
58  );
59  return null;
60  }
61  if (count($state['Attributes'][$this->attribute]) > 1) {
63  'More than one value in attribute '.var_export($this->attribute, true).
64  ' on user - not generating attribute NameID.'
65  );
66  return null;
67  }
68  $value = array_values($state['Attributes'][$this->attribute]); // just in case the first index is no longer 0
69  $value = $value[0];
70 
71  if (empty($value)) {
73  'Empty value in attribute '.var_export($this->attribute, true).
74  ' on user - not generating persistent NameID.'
75  );
76  return null;
77  }
78 
79  return $value;
80  }
if(!array_key_exists('stateid', $_REQUEST)) $state
Handle linkback() response from LinkedIn.
Definition: linkback.php:10
static warning($string)
Definition: Logger.php:177
+ Here is the call graph for this function:

Field Documentation

◆ $attribute

sspmod_saml_Auth_Process_AttributeNameID::$attribute
private

Definition at line 17 of file AttributeNameID.php.


The documentation for this class was generated from the following file: