szabogyula / simplesamlphp-module-attributecollector
此软件包最新版本(2.1.0)没有可用的许可证信息。
从后端数据库(如sql或ldap)收集属性
2.1.0
2021-10-13 06:35 UTC
Requires
Requires (Dev)
- simplesamlphp/simplesamlphp: 1.19.1
README
simplesamlphp认证处理过滤器,从后端数据库获取属性并将其设置为属性数组。
此代码来自: https://forja.rediris.es/svn/confia/attributecollector
基本配置
将此模块配置为Auth Proc Filter。更多信息请参阅 http://rnd.feide.no/content/authentication-processing-filters-simplesamlphp
示例
以下示例中,过滤器仅配置为仅针对一个托管IdP编辑saml20-idp-hosted文件
$metadata = array( 'ssp-idp' => array( ... 'authproc' => array( 10 => array( 'existing' => 'preserve', 'class' => 'attributecollector:AttributeCollector', 'uidfield' => 'subject', 'strict' => false, # optional 'collector' => array( 'class' => 'attributecollector:SQLCollector', 'dsn' => 'pgsql:host=localhost;dbname=ssp-extra', 'username' => 'ssp-extra', 'password' => 'ssp-extra', 'query' => 'SELECT * from extra where subject=:uidfield', ) ) ), ... ) );
配置选项说明
过滤器需要以下选项
- class: 过滤器类。始终为:'attributecollector:AttributeCollector'
- uidfield: 用来作为唯一用户标识的字段名称。配置的收集器接收到此uid,以便可以搜索额外的属性。
- collector: 用于检索额外属性的收集器配置
以下选项是可选的
- existing: 当收集的属性已存在于用户属性中时,告诉过滤器如何处理。值可以是:'preserve':忽略收集的属性并保留旧的一个。这是默认行为。'replace':忽略原始属性并用收集的一个替换它。'merge':将收集的属性合并到原始属性的数组中。
- strict: 默认为false,如果映射用户未在映射后端数据库中找到或
uidfield
属性中没有值,则中断登录流程。
收集器配置选项说明
收集器配置数组至少需要一个选项
- class: 收集器类。
收集器可能还需要其他一些选项,请参阅收集器文档。