ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
sspmod_saml_BaseNameIDGenerator Class Reference
+ Inheritance diagram for sspmod_saml_BaseNameIDGenerator:
+ Collaboration diagram for sspmod_saml_BaseNameIDGenerator:

Public Member Functions

 __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 Attributes

 $format
 

Private Attributes

 $nameQualifier
 
 $spNameQualifier
 

Additional Inherited Members

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

Detailed Description

Definition at line 8 of file BaseNameIDGenerator.php.

Constructor & Destructor Documentation

◆ __construct()

sspmod_saml_BaseNameIDGenerator::__construct (   $config,
  $reserved 
)

Initialize this filter, parse configuration.

Parameters
array$configConfiguration information about this filter.
mixed$reservedFor future use.

Definition at line 50 of file BaseNameIDGenerator.php.

References $config, $state, array, and getValue().

50  {
51  parent::__construct($config, $reserved);
52  assert('is_array($config)');
53 
54  if (isset($config['NameQualifier'])) {
55  $this->nameQualifier = $config['NameQualifier'];
56  } else {
57  $this->nameQualifier = FALSE;
58  }
59 
60  if (isset($config['SPNameQualifier'])) {
61  $this->spNameQualifier = $config['SPNameQualifier'];
62  } else {
63  $this->spNameQualifier = TRUE;
64  }
65  }
+ Here is the call graph for this function:

Member Function Documentation

◆ getValue()

sspmod_saml_BaseNameIDGenerator::getValue ( array $state)
abstractprotected

Get the NameID value.

Returns
string|NULL The NameID value.

Referenced by __construct(), and process().

+ Here is the caller graph for this function:

◆ process()

sspmod_saml_BaseNameIDGenerator::process ( $state)

Generate transient NameID.

Parameters
array&$stateThe request state.

Definition at line 81 of file BaseNameIDGenerator.php.

References $format, $nameId, $nameQualifier, $spNameQualifier, getValue(), and SimpleSAML\Logger\warning().

81  {
82  assert('is_array($state)');
83  assert('is_string($this->format)');
84 
85  $value = $this->getValue($state);
86  if ($value === NULL) {
87  return;
88  }
89 
90  $nameId = new \SAML2\XML\saml\NameID();
91  $nameId->value = $value;
92 
93  if ($this->nameQualifier === TRUE) {
94  if (isset($state['IdPMetadata']['entityid'])) {
95  $nameId->NameQualifier = $state['IdPMetadata']['entityid'];
96  } else {
97  SimpleSAML\Logger::warning('No IdP entity ID, unable to set NameQualifier.');
98  }
99  } elseif (is_string($this->nameQualifier)) {
100  $nameId->NameQualifier = $this->nameQualifier;
101  }
102 
103  if ($this->spNameQualifier === TRUE) {
104  if (isset($state['SPMetadata']['entityid'])) {
105  $nameId->SPNameQualifier = $state['SPMetadata']['entityid'];
106  } else {
107  SimpleSAML\Logger::warning('No SP entity ID, unable to set SPNameQualifier.');
108  }
109  } elseif (is_string($this->spNameQualifier)) {
110  $nameId->SPNameQualifier = $this->spNameQualifier;
111  }
112 
113  $state['saml:NameID'][$this->format] = $nameId;
114  }
$nameId
Definition: saml2-acs.php:138
if(!array_key_exists('stateid', $_REQUEST)) $state
Handle linkback() response from LinkedIn.
Definition: linkback.php:10
static warning($string)
Definition: Logger.php:179
getValue(array &$state)
Get the NameID value.
+ Here is the call graph for this function:

Field Documentation

◆ $format

sspmod_saml_BaseNameIDGenerator::$format
protected

Definition at line 41 of file BaseNameIDGenerator.php.

Referenced by process().

◆ $nameQualifier

sspmod_saml_BaseNameIDGenerator::$nameQualifier
private

Definition at line 19 of file BaseNameIDGenerator.php.

Referenced by process().

◆ $spNameQualifier

sspmod_saml_BaseNameIDGenerator::$spNameQualifier
private

Definition at line 31 of file BaseNameIDGenerator.php.

Referenced by process().


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