Returns the settings info
public getSettings ( ) : OneLogin_Saml2_Settings | ||
Résultat | OneLogin_Saml2_Settings | The settings data. |
/** * Get URL to follow to get logged out * @return string */ public function getLogoutUrl() { if (empty($GLOBALS['sugar_config']['SAML_SLO'])) { return; } $auth = new OneLogin_Saml2_Auth(SAMLAuthenticate::loadSettings()); $req = new OneLogin_Saml2_LogoutRequest($auth->getSettings()); return $GLOBALS['sugar_config']['SAML_SLO'] . "?SAMLRequest=" . urlencode($req->getRequest()); }
public function __construct($settings = null) { $auth = new OneLogin_Saml2_Auth($settings); $this->_settings = $auth->getSettings(); }
/** * Tests the setStrict method of the OneLogin_Saml2_Auth * * @covers OneLogin_Saml2_Auth::setStrict */ public function testSetStrict() { $settingsDir = TEST_ROOT . '/settings/'; include $settingsDir . 'settings1.php'; $settingsInfo['strict'] = false; $auth = new OneLogin_Saml2_Auth($settingsInfo); $settings = $auth->getSettings(); $this->assertFalse($settings->isStrict()); $auth->setStrict(true); $settings = $auth->getSettings(); $this->assertTrue($settings->isStrict()); $auth->setStrict(false); $settings = $auth->getSettings(); $this->assertFalse($settings->isStrict()); try { $auth->setStrict('a'); $this->assertTrue(false); } catch (Exception $e) { $this->assertContains('Assertion "is_bool($value)" failed', $e->getMessage()); } }
/** * Constructor that process the SAML Response, * Internally initializes an SP SAML instance * and an OneLogin_Saml2_Response. * * @param OneLogin_Saml_Settings $oldSettings Settings * @param string $$assertion SAML Response */ public function __construct($oldSettings, $assertion) { $auth = new OneLogin_Saml2_Auth($oldSettings); $settings = $auth->getSettings(); parent::__construct($settings, $assertion); }
<?php /** * SP Metadata Endpoint */ require_once dirname(dirname(__FILE__)) . '/_toolkit_loader.php'; try { $auth = new OneLogin_Saml2_Auth(); $settings = $auth->getSettings(); $metadata = $settings->getSPMetadata(); $errors = $settings->validateMetadata($metadata); if (empty($errors)) { header('Content-Type: text/xml'); echo $metadata; } else { throw new OneLogin_Saml2_Error('Invalid SP metadata: ' . implode(', ', $errors), OneLogin_Saml2_Error::METADATA_SP_INVALID); } } catch (Exception $e) { echo $e->getMessage(); }