本文整理汇总了PHP中SimpleSAML_Auth_Source::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP SimpleSAML_Auth_Source::__construct方法的具体用法?PHP SimpleSAML_Auth_Source::__construct怎么用?PHP SimpleSAML_Auth_Source::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimpleSAML_Auth_Source
的用法示例。
在下文中一共展示了SimpleSAML_Auth_Source::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor for this authentication source.
*
* @param array $info Information about this authentication source.
* @param array $config The configuration of the module
*
* @throws Exception If the KRB5 extension is not installed or active.
*/
public function __construct($info, $config)
{
assert('is_array($info)');
assert('is_array($config)');
if (!extension_loaded('krb5')) {
throw new Exception('KRB5 Extension not installed');
}
// call the parent constructor first, as required by the interface
parent::__construct($info, $config);
$config = SimpleSAML_Configuration::loadFromArray($config);
$this->backend = $config->getString('fallback');
$this->hostname = $config->getString('hostname');
$this->port = $config->getInteger('port', 389);
$this->referrals = $config->getBoolean('referrals', true);
$this->enableTLS = $config->getBoolean('enable_tls', false);
$this->debugLDAP = $config->getBoolean('debugLDAP', false);
$this->timeout = $config->getInteger('timeout', 30);
$this->keytab = $config->getString('keytab');
$this->base = $config->getArrayizeString('base');
$this->attr = $config->getString('attr', 'uid');
$this->subnet = $config->getArray('subnet', null);
$this->admin_user = $config->getString('adminUser', null);
$this->admin_pw = $config->getString('adminPassword', null);
$this->attributes = $config->getArray('attributes', null);
}
示例2: __construct
/**
* Constructor for this authentication source.
*
* @param array $info Information about this authentication source.
* @param array $config Configuration.
*/
public function __construct($info, $config)
{
assert('is_array($info)');
assert('is_array($config)');
/* Call the parent constructor first, as required by the interface. */
parent::__construct($info, $config);
if (!array_key_exists('serverurl', $config)) {
throw new Exception('aselect serverurl not specified');
}
$this->asconfig['serverurl'] = $config['serverurl'];
if (!array_key_exists('serverid', $config)) {
throw new Exception('aselect serverid not specified');
}
$this->asconfig['serverid'] = $config['serverid'];
if (!array_key_exists('type', $config)) {
throw new Exception('aselect type not specified');
}
$this->asconfig['type'] = $config['type'];
if ($this->asconfig['type'] == 'app') {
if (!array_key_exists('app_id', $config)) {
throw new Exception('aselect app_id not specified');
}
$this->asconfig['app_id'] = $config['app_id'];
} elseif ($this->asconfig['type'] == 'cross') {
if (!array_key_exists('local_organization', $config)) {
throw new Exception('aselect local_organization not specified');
}
$this->asconfig['local_organization'] = $config['local_organization'];
$this->asconfig['required_level'] = array_key_exists('required_level', $config) ? $config['required_level'] : 10;
} else {
throw new Exception('aselect type need to be either app or cross');
}
}
示例3: __construct
public function __construct($info, $config)
{
assert('is_array($info)');
assert('is_array($config)');
/* Call the parent constructor first, as required by the interface. */
parent::__construct($info, $config);
}
示例4: __construct
/**
* Constructor for this authentication source.
*
* @param array $info Information about this authentication source.
* @param array $config Configuration.
*/
public function __construct($info, $config)
{
assert('is_array($info)');
assert('is_array($config)');
/* Call the parent constructor first, as required by the interface. */
parent::__construct($info, $config);
if (!array_key_exists('cas', $config)) {
throw new Exception('cas authentication source is not properly configured: missing [cas]');
}
if (!array_key_exists('ldap', $config)) {
throw new Exception('ldap authentication source is not properly configured: missing [ldap]');
}
$this->_casConfig = $config['cas'];
$this->_ldapConfig = $config['ldap'];
if (isset($this->_casConfig['serviceValidate'])) {
$this->_validationMethod = 'serviceValidate';
} elseif (isset($this->_casConfig['validate'])) {
$this->_validationMethod = 'validate';
} else {
throw new Exception("validate or serviceValidate not specified");
}
if (isset($this->_casConfig['login'])) {
$this->_loginMethod = $this->_casConfig['login'];
} else {
throw new Exception("cas login url not specified");
}
}
示例5: __construct
/**
* Constructor for Google authentication source.
*
* @param array $info Information about this authentication source.
* @param array $config Configuration.
*/
public function __construct($info, $config)
{
assert('is_array($info)');
assert('is_array($config)');
/* Call the parent constructor first, as required by the interface. */
parent::__construct($info, $config);
if (!array_key_exists('key', $config)) {
throw new Exception('Google authentication source is not properly configured: missing [key]');
}
$this->key = $config['key'];
if (!array_key_exists('secret', $config)) {
throw new Exception('Google authentication source is not properly configured: missing [secret]');
}
$this->secret = $config['secret'];
$this->linkback = SimpleSAML_Module::getModuleURL('authgoogleOIDC') . '/linkback.php';
// Create Client
$this->client = new Google_Client();
$this->client->setApplicationName('Google gateway');
$this->client->setClientId($this->key);
$this->client->setClientSecret($this->secret);
$this->client->setRedirectUri($this->linkback);
$this->client->addScope('openid');
$this->client->addScope('profile');
$this->client->addScope('email');
}
示例6: __construct
/**
* Constructor for this authentication source.
*
* @param array $info Information about this authentication source.
* @param array $config Configuration.
*/
public function __construct($info, $config)
{
assert('is_array($info)');
assert('is_array($config)');
// Call the parent constructor first, as required by the interface
parent::__construct($info, $config);
// Do any other configuration we need here
}
示例7: __construct
/**
* Constructor for this authentication source.
*
* All subclasses who implement their own constructor must call this constructor before
* using $config for anything.
*
* @param array $info Information about this authentication source.
* @param array &$config Configuration for this authentication source.
*/
public function __construct($info, &$config)
{
assert('is_array($info)');
assert('is_array($config)');
/* Call the parent constructor first, as required by the interface. */
parent::__construct($info, $config);
$this->usernameOrgMethod = 'none';
}
示例8: __construct
/**
* Constructor for this authentication source.
*
* @param array $info Information about this authentication source.
* @param array $config Configuration.
*/
public function __construct($info, $config)
{
assert('is_array($info)');
assert('is_array($config)');
/* Call the parent constructor first, as required by the interface. */
parent::__construct($info, $config);
$this->userPassSource = $config['userPassSource'];
}
示例9: __construct
/**
* Constructor for this authentication source.
*
* All subclasses who implement their own constructor must call this constructor before
* using $config for anything.
*
* @param array $info Information about this authentication source.
* @param array &$config Configuration for this authentication source.
*/
public function __construct($info, &$config)
{
assert('is_array($info)');
assert('is_array($config)');
if (isset($config['core:loginpage_links'])) {
$this->loginLinks = $config['core:loginpage_links'];
}
/* Call the parent constructor first, as required by the interface. */
parent::__construct($info, $config);
}
示例10: __construct
/**
* Constructor for this authentication source.
*
* @param array $info Information about this authentication source.
* @param array $config Configuration.
*/
public function __construct($info, $config)
{
/* Call the parent constructor first, as required by the interface. */
parent::__construct($info, $config);
$this->clientId = $config['client_id'];
$this->clientSecret = $config['client_secret'];
$this->tokenEndpoint = $config['token_endpoint'];
$this->userInfoEndpoint = $config['user_info_endpoint'];
$this->authEndpoint = $config['auth_endpoint'];
$this->sslcapath = $config['sslcapath'];
}
示例11: __construct
/**
* Constructor for this authentication source.
*
* @param array $info Information about this authentication source.
* @param array $config Configuration.
*/
public function __construct($info, $config)
{
assert('is_array($info)');
assert('is_array($config)');
/* Call the parent constructor first, as required by the interface. */
parent::__construct($info, $config);
if (!array_key_exists('sources', $config)) {
throw new Exception('The required "sources" config option was not found');
}
$this->sources = $config['sources'];
}
示例12: __construct
/**
* Constructor for this authentication source.
*
* @param array $info Information about this authentication source.
* @param array $config Configuration.
*/
public function __construct($info, $config)
{
assert('is_array($info)');
assert('is_array($config)');
/* Call the parent constructor first, as required by the interface. */
parent::__construct($info, $config);
$configObject = SimpleSAML_Configuration::loadFromArray($config, 'authsources[' . var_export($this->authId, TRUE) . ']');
$this->key = $configObject->getString('key');
$this->secret = $configObject->getString('secret');
$this->force_login = $configObject->getBoolean('force_login', FALSE);
}
示例13: __construct
/**
* Constructor for this authentication source.
*
* @param array $info Information about this authentication source.
* @param array $config Configuration.
*/
public function __construct($info, $config)
{
assert('is_array($info)');
assert('is_array($config)');
/* Call the parent constructor first, as required by the interface. */
parent::__construct($info, $config);
$cfgParse = SimpleSAML_Configuration::loadFromArray($config, 'authsources[' . var_export($this->authId, TRUE) . ']');
$this->api_key = $cfgParse->getString('api_key');
$this->secret = $cfgParse->getString('secret');
$this->req_perms = $cfgParse->getString('req_perms', NULL);
}
示例14: __construct
/**
* Constructor for this authentication source.
*
* @param array $info Information about this authentication source.
* @param array $config Configuration.
*/
public function __construct($info, $config)
{
assert('is_array($info)');
assert('is_array($config)');
/* Call the parent constructor first, as required by the interface. */
parent::__construct($info, $config);
if (!array_key_exists('uid', $config) || !is_string($config['uid'])) {
throw new SimpleSAML_Error_Exception("AA configuration error, 'uid' not found or not a string.");
}
SimpleSAML_Logger::debug('[aa] auth source Bypass: config uid: ' . $config['uid']);
$this->uid = $config['uid'];
}
示例15: __construct
/**
* Constructor for this authentication source.
*
* @param array $info Information about this authentication source.
* @param array $config Configuration.
*/
public function __construct($info, $config)
{
/* Call the parent constructor first, as required by the interface. */
parent::__construct($info, $config);
$cfgParse = SimpleSAML_Configuration::loadFromArray($config, 'Authentication source ' . var_export($this->authId, TRUE));
$this->target = $cfgParse->getString('target', NULL);
$this->realm = $cfgParse->getString('realm', NULL);
$this->optionalAttributes = $cfgParse->getArray('attributes.optional', array());
$this->requiredAttributes = $cfgParse->getArray('attributes.required', array());
$this->optionalAXAttributes = $cfgParse->getArray('attributes.ax_optional', array());
$this->requiredAXAttributes = $cfgParse->getArray('attributes.ax_required', array());
$this->validateSReg = $cfgParse->getBoolean('sreg.validate', TRUE);
}