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

Public Member Functions

 __construct ($config, $reserved)
 
 process (&$request)
 Apply filter to add or replace attributes. More...
 
- Public Member Functions inherited from SimpleSAML_Auth_ProcessingFilter
 __construct (&$config, $reserved)
 Constructor for a processing filter. More...
 
 process (&$request)
 Process a request. More...
 

Private Member Functions

 addID ($attributes, $request)
 

Private Attributes

 $_candidates
 Which attributes to use as identifiers? More...
 
 $_id_attribute = 'smart_id'
 The name of the generated ID attribute. More...
 
 $_add_authority = true
 Whether to append the AuthenticatingAuthority, separated by '!' This only works when SSP is used as a gateway. More...
 
 $_add_candidate = true
 Whether to prepend the CandidateID, separated by ':'. More...
 
 $attributes = array()
 Attributes which should be added/appended. More...
 

Additional Inherited Members

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

Detailed Description

Definition at line 3 of file SmartID.php.

Constructor & Destructor Documentation

◆ __construct()

sspmod_smartattributes_Auth_Process_SmartID::__construct (   $config,
  $reserved 
)

Definition at line 47 of file SmartID.php.

References $config.

47  {
48  parent::__construct($config, $reserved);
49 
50  assert('is_array($config)');
51 
52  if (array_key_exists('candidates', $config)) {
53  $this->_candidates = $config['candidates'];
54  if (!is_array($this->_candidates)) {
55  throw new Exception('SmartID authproc configuration error: \'candidates\' should be an array.');
56  }
57  }
58 
59  if (array_key_exists('id_attribute', $config)) {
60  $this->_id_attribute = $config['id_attribute'];
61  if (!is_string($this->_id_attribute)) {
62  throw new Exception('SmartID authproc configuration error: \'id_attribute\' should be a string.');
63  }
64  }
65 
66  if (array_key_exists('add_authority', $config)) {
67  $this->_add_authority = $config['add_authority'];
68  if (!is_bool($this->_add_authority)) {
69  throw new Exception('SmartID authproc configuration error: \'add_authority\' should be a boolean.');
70  }
71  }
72 
73  if (array_key_exists('add_candidate', $config)) {
74  $this->_add_candidate = $config['add_candidate'];
75  if (!is_bool($this->_add_candidate)) {
76  throw new Exception('SmartID authproc configuration error: \'add_candidate\' should be a boolean.');
77  }
78  }
79 
80  }

Member Function Documentation

◆ addID()

sspmod_smartattributes_Auth_Process_SmartID::addID (   $attributes,
  $request 
)
private

Definition at line 82 of file SmartID.php.

References $attributes.

Referenced by process().

82  {
83  foreach ($this->_candidates as $idCandidate) {
84  if (isset($attributes[$idCandidate][0])) {
85  if(($this->_add_authority) && (isset($request['saml:AuthenticatingAuthority'][0]))) {
86  return ($this->_add_candidate ? $idCandidate.':' : '').$attributes[$idCandidate][0] . '!' . $request['saml:AuthenticatingAuthority'][0];
87  } else {
88  return ($this->_add_candidate ? $idCandidate.':' : '').$attributes[$idCandidate][0];
89  }
90  }
91  }
92  /*
93  * At this stage no usable id_candidate has been detected.
94  */
95  throw new SimpleSAML_Error_Exception('This service needs at least one of the following
96  attributes to identity users: '.implode(', ', $this->_candidates).'. Unfortunately not
97  one of them was detected. Please ask your institution administrator to release one of
98  them, or try using another identity provider.');
99  }
$attributes
Attributes which should be added/appended.
Definition: SmartID.php:44
+ Here is the caller graph for this function:

◆ process()

sspmod_smartattributes_Auth_Process_SmartID::process ( $request)

Apply filter to add or replace attributes.

Add or replace existing attributes with the configured values.

Parameters
array&$requestThe current request

Definition at line 109 of file SmartID.php.

References $_id_attribute, addID(), and array.

109  {
110  assert('is_array($request)');
111  assert('array_key_exists("Attributes", $request)');
112 
113  $ID = $this->addID($request['Attributes'], $request);
114 
115  if(isset($ID)) $request['Attributes'][$this->_id_attribute] = array($ID);
116  }
$_id_attribute
The name of the generated ID attribute.
Definition: SmartID.php:26
Create styles array
The data for the language used.
+ Here is the call graph for this function:

Field Documentation

◆ $_add_authority

sspmod_smartattributes_Auth_Process_SmartID::$_add_authority = true
private

Whether to append the AuthenticatingAuthority, separated by '!' This only works when SSP is used as a gateway.

Definition at line 32 of file SmartID.php.

◆ $_add_candidate

sspmod_smartattributes_Auth_Process_SmartID::$_add_candidate = true
private

Whether to prepend the CandidateID, separated by ':'.

Definition at line 37 of file SmartID.php.

◆ $_candidates

sspmod_smartattributes_Auth_Process_SmartID::$_candidates
private
Initial value:
'eduPersonTargetedID',
'eduPersonPrincipalName',
'openid',
'facebook_targetedID',
'twitter_targetedID',
'windowslive_targetedID',
'myspace_targetedID',
'linkedin_targetedID',
)

Which attributes to use as identifiers?

IMPORTANT: If you use the (default) attributemaps (twitter2name, facebook2name, etc., be sure to comment out the entries that map xxx_targetedID to eduPersonTargetedID, or there will be no way to see its origin any more.

Definition at line 12 of file SmartID.php.

◆ $_id_attribute

sspmod_smartattributes_Auth_Process_SmartID::$_id_attribute = 'smart_id'
private

The name of the generated ID attribute.

Definition at line 26 of file SmartID.php.

Referenced by process().

◆ $attributes

sspmod_smartattributes_Auth_Process_SmartID::$attributes = array()
private

Attributes which should be added/appended.

Associative array of arrays.

Definition at line 44 of file SmartID.php.

Referenced by addID().


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