niif / simplesamlphp-module-attributescope
此包的最新版本(v1.0.3)没有可用的许可证信息。
过滤以移除未正确定义作用域的属性值。
v1.0.3
2018-06-28 21:21 UTC
Requires
Requires (Dev)
- phpunit/phpunit: ~4.8.35
- simplesamlphp/simplesamlphp: 1.14
This package is auto-updated.
Last update: 2024-09-08 01:52:40 UTC
README
该模块确保作用域属性(如eduPersonPrincipalName)在实体元数据中具有正确的定义。
它移除以下值
- 应具有作用域(见下文
attributesWithScope
)但未定义的值; - 其作用域与元数据中的shibmd:Scope元素不匹配。
此外,它还能够处理类似于schacHomeOrganization的“作用域属性”,这些属性应与元数据中的shibmd:Scope
元素等效。
注意事项和限制
shibmd:Scope
中的正则表达式不受支持。- 建议在oid2name之后运行此过滤器。请注意,模块配置中的属性名称区分大小写,并且必须与attributemaps中的名称匹配。
- “作用域属性”必须是单值,否则将被删除。
- 在多个配置选项中指定属性可能是用户配置问题。只有当值符合每个配置选项的验证规则时,才会通过。
安装模块
您可以使用composer安装模块
composer require niif/simplesamlphp-module-attributescope
示例配置
config/config.php
authproc.sp = array(
...
// 49 => array('class' => 'core:AttributeMap', 'oid2name'),
// Verify scoped attributes with the metadata:
50 => array(
'class' => 'attributescope:FilterAttributes',
// Default attributes with scope attributes.
// 'attributesWithScope' => array('eduPersonPrincipalName', 'eduPersonScopedAffiliation'),
// Default scopeAttribute
// 'scopeAttributes' => array('schacHomeOrganization'),
),
配置选项
attributesWithScope
应具有作用域并应与元数据中的作用域匹配的属性数组attributesWithScopeSuffix
具有作用域作为后缀的属性数组。例如,user@department.example.com
和department.example.com
都带有后缀example.com
。当SP依赖于mail
属性来识别用户,而IdP为邮件使用各种子域时,非常有用。scopeAttributes
应与元数据中的作用域完全匹配的属性数组ignoreCheckForEntities
是要跳过作用域检查的IdP实体ID数组。当IdP是SAML代理并且信任声明任何作用域时,非常有用。ignoreCase
忽略作用域属性的字母大小写。新的“主题标识符属性”配置文件规定比较应忽略大小写。默认为false,以保持向后兼容性。
开发
运行测试
./vendor/phpunit/phpunit/phpunit