silinternational / simplesamlphp-module-profilereview
simpleSAMLphp模块,用于提示用户审查其配置文件(例如2fa、电子邮件等)。
Requires
- php: >=7.2
- ext-json: *
- silinternational/php-env: ^2.1 || ^3.0
- silinternational/psr3-adapters: ^1.1 || ^2.0 || ^3.0
- simplesamlphp/simplesamlphp: ~1.18.6 || ~1.19.0
- sinergi/browser-detector: ^6.1
Requires (Dev)
- behat/behat: ^3.3
- behat/mink: ^1.7
- behat/mink-goutte-driver: ^1.2
- phpunit/phpunit: ^8.4
- roave/security-advisories: dev-master
README
此存储库不再维护。它已被直接包含在https://github.com/silinternational/ssp-base中。
--
Profile Review simpleSAMLphp模块
一个simpleSAMLphp模块,用于提示用户审查其配置文件(如2步验证、电子邮件等)。
此模块作为认证处理过滤器(AuthProc)实现。这意味着它可以在全局config.php文件或SP远程或IdP托管元数据中进行配置。
建议在所有其他认证模块之后在IdP上运行profilereview模块。
如何使用此模块
只需在您的composer.json
文件中包含simplesamlphp/composer-module-installer
和此模块即可。该composer-module-installer
包将发现此模块并将其复制到simplesamlphp
中的modules
文件夹。
然后您需要在您的配置中设置过滤器参数。我们建议将它们添加到metadata/saml20-idp-hosted.php
文件中的'authproc'
数组中。
示例(针对metadata/saml20-idp-hosted.php
)
use Sil\PhpEnv\Env;
use Sil\Psr3Adapters\Psr3SamlLogger;
// ...
'authproc' => [
10 => [
// Required:
'class' => 'profilereview:ProfileReview',
'employeeIdAttr' => 'employeeNumber',
'profileUrl' => Env::get('PROFILE_URL'),
'mfaLearnMoreUrl' => Env::get('MFA_LEARN_MORE_URL'),
// Optional:
'loggerClass' => Psr3SamlLogger::class,
],
// ...
],
employeeIdAttr
参数表示存储用户员工ID的SAML属性名称。在某些情况下,这可能显示给用户,并用于日志消息。
loggerClass
参数指定了一个PSR-3兼容的类名称,可以自动加载,用作ExpiryDate中的记录器。
profileUrl
参数是用户想要/需要更新其配置文件时发送的URL。
本地测试
设置
将条目添加到您的hosts文件中,将profilereview-sp.local
和profilereview-idp.local
与docker容器的IP地址关联。
自动化测试
运行make test
。
手动测试
在浏览器中转到http://profilereview-sp.local:52041/module.php/core/authenticate.php?as=profilereview-idp并使用在development/idp-local/config/authsources.php
中定义的用户之一登录。
贡献
要贡献,请在https://github.com/silinternational/simplesamlphp-module-profilereview提交问题或拉取请求。
致谢
这是从silinternational/simplesamlphp-module-mfa
模块改编而来,该模块本身又是从其他模块改编而来。感谢所有为此工作做出贡献的人。