ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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, and getValue().

51  {
52  parent::__construct($config, $reserved);
53  assert(is_array($config));
54 
55  if (isset($config['NameQualifier'])) {
56  $this->nameQualifier = $config['NameQualifier'];
57  } else {
58  $this->nameQualifier = false;
59  }
60 
61  if (isset($config['SPNameQualifier'])) {
62  $this->spNameQualifier = $config['SPNameQualifier'];
63  } else {
64  $this->spNameQualifier = true;
65  }
66  }
$config
Definition: bootstrap.php:15
+ 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 82 of file BaseNameIDGenerator.php.

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

83  {
84  assert(is_array($state));
85  assert(is_string($this->format));
86 
87  $value = $this->getValue($state);
88  if ($value === null) {
89  return;
90  }
91 
92  $nameId = new \SAML2\XML\saml\NameID();
93  $nameId->value = $value;
94 
95  if ($this->nameQualifier === true) {
96  if (isset($state['IdPMetadata']['entityid'])) {
97  $nameId->NameQualifier = $state['IdPMetadata']['entityid'];
98  } else {
99  SimpleSAML\Logger::warning('No IdP entity ID, unable to set NameQualifier.');
100  }
101  } elseif (is_string($this->nameQualifier)) {
102  $nameId->NameQualifier = $this->nameQualifier;
103  }
104 
105  if ($this->spNameQualifier === true) {
106  if (isset($state['SPMetadata']['entityid'])) {
107  $nameId->SPNameQualifier = $state['SPMetadata']['entityid'];
108  } else {
109  SimpleSAML\Logger::warning('No SP entity ID, unable to set SPNameQualifier.');
110  }
111  } elseif (is_string($this->spNameQualifier)) {
112  $nameId->SPNameQualifier = $this->spNameQualifier;
113  }
114 
115  $state['saml:NameID'][$this->format] = $nameId;
116  }
$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:177
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: