ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
SAML2\Configuration\SimpleSAMLConverter Class Reference

Backwards compatibility helper for SimpleSAMLphp. More...

+ Collaboration diagram for SAML2\Configuration\SimpleSAMLConverter:

Static Public Member Functions

static convertToIdentityProvider (SimpleSAML_Configuration $configuration, $certificatePrefix='')
 
static convertToServiceProvider (SimpleSAML_Configuration $configuration, $certificatePrefix='')
 

Static Private Member Functions

static pluckConfiguration (SimpleSAML_Configuration $configuration, $prefix='')
 
static enrichForIdentityProvider (SimpleSAML_Configuration $configuration, &$baseConfiguration)
 
static enrichForServiceProvider (SimpleSAML_Configuration $configuration, &$baseConfiguration)
 
static enrichForDecryptionProvider (SimpleSAML_Configuration $configuration, array &$baseConfiguration)
 

Detailed Description

Backwards compatibility helper for SimpleSAMLphp.

Definition at line 10 of file SimpleSAMLConverter.php.

Member Function Documentation

◆ convertToIdentityProvider()

static SAML2\Configuration\SimpleSAMLConverter::convertToIdentityProvider ( SimpleSAML_Configuration  $configuration,
  $certificatePrefix = '' 
)
static
Parameters
\SimpleSAML_Configuration$configuration
string$certificatePrefix
Returns

Definition at line 18 of file SimpleSAMLConverter.php.

21  {
22  $pluckedConfiguration = static::pluckConfiguration($configuration, $certificatePrefix);
23  static::enrichForDecryptionProvider($configuration, $pluckedConfiguration);
24  static::enrichForIdentityProvider($configuration, $pluckedConfiguration);
25 
26  return new IdentityProvider($pluckedConfiguration);
27  }

◆ convertToServiceProvider()

static SAML2\Configuration\SimpleSAMLConverter::convertToServiceProvider ( SimpleSAML_Configuration  $configuration,
  $certificatePrefix = '' 
)
static
Parameters
\SimpleSAML_Configuration$configuration
string$certificatePrefix
Returns

Definition at line 35 of file SimpleSAMLConverter.php.

38  {
39  $pluckedConfiguration = static::pluckConfiguration($configuration, $certificatePrefix);
40  static::enrichForServiceProvider($configuration, $pluckedConfiguration);
41  static::enrichForDecryptionProvider($configuration, $pluckedConfiguration);
42 
43  return new ServiceProvider($pluckedConfiguration);
44  }

◆ enrichForDecryptionProvider()

static SAML2\Configuration\SimpleSAMLConverter::enrichForDecryptionProvider ( SimpleSAML_Configuration  $configuration,
array $baseConfiguration 
)
staticprivate

Definition at line 100 of file SimpleSAMLConverter.php.

References SimpleSAML_Configuration\getBoolean(), SimpleSAML_Configuration\getString(), SAML2\Configuration\PrivateKey\NAME_DEFAULT, and SAML2\Configuration\PrivateKey\NAME_NEW.

103  {
104  if ($configuration->has('sharedKey')) {
105  $baseConfiguration['sharedKey'] = $configuration->getString('sharedKey', null);
106  }
107 
108  if ($configuration->has('new_privatekey')) {
109  $baseConfiguration['privateKeys'][] = new PrivateKey(
110  $configuration->getString('new_privatekey'),
112  $configuration->getString('new_privatekey_pass', null)
113  );
114  }
115 
116  if ($configuration->getBoolean('assertion.encryption', false)) {
117  $baseConfiguration['privateKeys'][] = new PrivateKey(
118  $configuration->getString('privatekey'),
120  $configuration->getString('privatekey_pass', null)
121  );
122 
123  if ($configuration->has('encryption.blacklisted-algorithms')) {
124  $baseConfiguration['blacklistedEncryptionAlgorithms'] = $configuration
125  ->get('encryption.blacklisted-algorithms');
126  }
127  }
128  }
getBoolean($name, $default=self::REQUIRED_OPTION)
This function retrieves a boolean configuration option.
getString($name, $default=self::REQUIRED_OPTION)
This function retrieves a string configuration option.
+ Here is the call graph for this function:

◆ enrichForIdentityProvider()

static SAML2\Configuration\SimpleSAMLConverter::enrichForIdentityProvider ( SimpleSAML_Configuration  $configuration,
$baseConfiguration 
)
staticprivate

Definition at line 89 of file SimpleSAMLConverter.php.

References SimpleSAML_Configuration\getBoolean(), and SimpleSAML_Configuration\getString().

90  {
91  $baseConfiguration['base64EncodedAttributes'] = $configuration->getBoolean('base64attributes', false);
92  $baseConfiguration['entityId'] = $configuration->getString('entityid');
93  }
getBoolean($name, $default=self::REQUIRED_OPTION)
This function retrieves a boolean configuration option.
getString($name, $default=self::REQUIRED_OPTION)
This function retrieves a string configuration option.
+ Here is the call graph for this function:

◆ enrichForServiceProvider()

static SAML2\Configuration\SimpleSAMLConverter::enrichForServiceProvider ( SimpleSAML_Configuration  $configuration,
$baseConfiguration 
)
staticprivate

Definition at line 95 of file SimpleSAMLConverter.php.

References SimpleSAML_Configuration\getString().

96  {
97  $baseConfiguration['entityId'] = $configuration->getString('entityid');
98  }
getString($name, $default=self::REQUIRED_OPTION)
This function retrieves a string configuration option.
+ Here is the call graph for this function:

◆ pluckConfiguration()

static SAML2\Configuration\SimpleSAMLConverter::pluckConfiguration ( SimpleSAML_Configuration  $configuration,
  $prefix = '' 
)
staticprivate
Parameters
\SimpleSAML_Configuration$configuration
string$prefix
Returns
array

Definition at line 52 of file SimpleSAMLConverter.php.

References array, SimpleSAML_Configuration\getArray(), SimpleSAML_Configuration\getArrayizeString(), SimpleSAML_Configuration\getBoolean(), SimpleSAML_Configuration\getString(), and SimpleSAML_Configuration\hasValue().

53  {
54  $extracted = array();
55 
56  // ported from
57  // https://github.com/simplesamlphp/simplesamlphp/blob/3d735912342767d391297cc5e13272a76730aca0/lib/SimpleSAML/Configuration.php#L1092
58  if ($configuration->hasValue($prefix . 'keys')) {
59  $extracted['keys'] = $configuration->getArray($prefix . 'keys');
60  }
61 
62  // ported from
63  // https://github.com/simplesamlphp/simplesamlphp/blob/3d735912342767d391297cc5e13272a76730aca0/lib/SimpleSAML/Configuration.php#L1108
64  if ($configuration->hasValue($prefix . 'certData')) {
65  $extracted['certificateData'] = $configuration->getString($prefix . 'certData');
66  }
67 
68  // ported from
69  // https://github.com/simplesamlphp/simplesamlphp/blob/3d735912342767d391297cc5e13272a76730aca0/lib/SimpleSAML/Configuration.php#L1119
70  if ($configuration->hasValue($prefix . 'certificate')) {
71  $extracted['certificateData'] = $configuration->getString($prefix . 'certificate');
72  }
73 
74  // ported from
75  // https://github.com/simplesamlphp/simplesamlphp/blob/3d735912342767d391297cc5e13272a76730aca0/modules/saml/lib/Message.php#L161
76  if ($configuration->hasValue($prefix . 'certFingerprint')) {
77  $extracted['certificateFingerprint'] = $configuration->getArrayizeString('certFingerprint');
78  }
79 
80  $extracted['assertionEncryptionEnabled'] = $configuration->getBoolean('assertion.encryption', false);
81 
82  if ($configuration->has('sharedKey')) {
83  $extracted['sharedKey'] = $configuration->getString('sharedKey');
84  }
85 
86  return $extracted;
87  }
getArray($name, $default=self::REQUIRED_OPTION)
This function retrieves an array configuration option.
hasValue($name)
Check whether a key in the configuration exists or not.
getBoolean($name, $default=self::REQUIRED_OPTION)
This function retrieves a boolean configuration option.
getArrayizeString($name, $default=self::REQUIRED_OPTION)
This function retrieves a configuration option with a string or an array of strings.
Create styles array
The data for the language used.
getString($name, $default=self::REQUIRED_OPTION)
This function retrieves a string configuration option.
+ Here is the call graph for this function:

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