szabogyula/simplesamlphp-module-attributecollector

此软件包最新版本(2.1.0)没有可用的许可证信息。

从后端数据库(如sql或ldap)收集属性

安装: 75

依赖项: 0

建议者: 0

安全: 0

星星: 0

关注者: 1

分支: 3

类型:simplesamlphp-module

2.1.0 2021-10-13 06:35 UTC

This package is auto-updated.

Last update: 2024-09-13 13:28:09 UTC


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: 收集器类。

收集器可能还需要其他一些选项,请参阅收集器文档。