drupalauth/simplesamlphp-module-drupalauth
Composer 安装命令:
composer require drupalauth/simplesamlphp-module-drupalauth
包简介
A SimpleSAMLphp module adding support for Drupal as the authentication source.
README 文档
README
Drupal + SimpleSAMLphp + drupalauth = Complete SAML Identity Provider (IdP)
Users interact with Drupal to create accounts, manage accounts, and authenticate. SAML SPs interact with SimpleSAMLphp. Drupalauth ties Drupal to SimpleSAMLphp.
The drupalauth module for simpleSAMLphp makes it easy to create a SAML or Shibboleth identity provider (IdP) by enabling authentication of users against a Drupal site on the same server. This allows the administrator to leverage the user management and integration capabilities of Drupal for managing the identity life cycle.
NOTE: This is software establishes a SAML identity provider (IdP) using Drupal as the user database instead of LDAP. If you want to establish your Drupal site as a SAML service provider (SP) connected to a SAML or Shibboleth IdP, see the simplesamlphp_auth module for Drupal.
simpleSAMLphp module
This module for SimpleSAMLphp provides an Authentication Source for authenticating users against a local Drupal site. This allows the administrator to leverage the user management and integration capabilities of Drupal for managing the identity life cycle and the power of SimpleSAMLphp for identity integration. This is a simpleSAMLphp module, NOT a Drupal module. Download this module only if you want to use Drupal as Identity Provider.
Drupal modules
If you want to use Drupal as Identity Provide you should also install drupalauth4ssp that is available on Drupal.org. Please note that all issues related to Drupal functionality should be reported there.
If you want to connect your Drupal site as Service Provider to a SAML or Shibboleth IdP, use the simplesamlphp_auth module for Drupal.
Branch and version naming
Following Semantic Versioning is hard when you have multiple upstream dependencies.
So in a X.Y.Z version:
- X - major SimpleSAMLphp version
- Y - major Drupal version
- Z - inthis module incremental version
Example: for SimpleSAMLphp version 1.15.4 with Drupal version 8.5.6 and this module version 1 we will have tag 1.8.1. Same thing for Drupal 7 will be 1.7.1.
main at the moment corresponds to 2.10.*. Branch 1.7 is respectfully for Drupal 7 (no Composer integration).
Note on Drupal configuration
Disabling discovery cache will prevent this module from functioning.
See this issue #71, specifically this comment.
Installation
Requirements
- Install Drupal 10.x
- Install simpleSAMLphp
- Install drupalauth -
composer require drupalauth/simplesamlphp-module-drupalauth - Configure SimpleSAMLphp to use something other than
phpsessionfor session storage, e.g., SQL or memcache (See:store.typeinsimplesamlphp/config/config.php). - Configure the authentication source in
simplesamlphp/config/authsources.phpas described below.
Authenticate against Drupal but use the SimpleSAMLphp login page
The advantage of this approach is that there is no obvious connection between SimpleSAMLphp IdP and the Drupal site.
Details
Configure the authentication source by putting following code into simplesamlphp/config/authsources.php
'drupal-userpass' => array( 'drupalauth:UserPass', // The filesystem path of the Drupal directory. 'drupalroot' => '/var/www/drupal', // Whether to turn on debug 'debug' => true, // Which attributes should be retrieved from the Drupal site. 'attributes' => array( array('field_name' => 'uid', 'attribute_name' => 'uid'), array('field_name' => 'roles', 'attribute_name' => 'roles', 'field_property' => 'target_id'), array('field_name' => 'name', 'attribute_name' => 'cn'), array('field_name' => 'mail', 'attribute_name' => 'mail'), array('field_name' => 'field_first_name', 'attribute_name' => 'givenName'), array('field_name' => 'field_last_name', 'attribute_name' => 'sn'), array('field_name' => 'field_organization', 'attribute_name' => 'ou', 'field_property' => 'target_id'), ), ),
Leave 'attributes' empty or unset to get all available field values. Attribute names in this case would be "$field_name:$property_name".
Authenticate against Drupal but use the Drupal login page
The advantage of this approach is that the SimpleSAMLphp IdP session is tied to a Drupal session. This allows the user who is already logged into the Drupal site to then navigate to a SAML SP that uses the IdP without the need to authenticate again.
Details
Configure the authentication source by putting following code into simplesamlphp/config/authsources.php
'drupal-userpass' => array('drupalauth:External', // The filesystem path of the Drupal directory. 'drupalroot' => '/var/www/drupal', // Whether to turn on debug 'debug' => true, // the URL of the Drupal logout page 'drupal_logout_url' => 'https://www.example.com/drupal/user/logout', // the URL of the Drupal login page 'drupal_login_url' => 'https://www.example.com/drupal/user/login', // Which attributes should be retrieved from the Drupal site. 'attributes' => array( array('field_name' => 'uid', 'attribute_name' => 'uid'), array('field_name' => 'roles', 'attribute_name' => 'roles', 'field_property' => 'target_id'), array('field_name' => 'name', 'attribute_name' => 'cn'), array('field_name' => 'mail', 'attribute_name' => 'mail'), array('field_name' => 'field_first_name', 'attribute_name' => 'givenName'), array('field_name' => 'field_last_name', 'attribute_name' => 'sn'), array('field_name' => 'field_organization', 'attribute_name' => 'ou', 'field_property' => 'target_id'), ), ),
drupalauth/simplesamlphp-module-drupalauth 适用场景与选型建议
drupalauth/simplesamlphp-module-drupalauth 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 320.24k 次下载、GitHub Stars 达 25, 最近一次更新时间为 2018 年 09 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「Authentication」 「drupal」 「simplesamlphp」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 drupalauth/simplesamlphp-module-drupalauth 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 drupalauth/simplesamlphp-module-drupalauth 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 drupalauth/simplesamlphp-module-drupalauth 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A SimpleSAMLphp module for using Redis for session storage etc.
Automatically logs-in users if they are already authenticated by a remote source. (e.g. environment variable REMOTE_USER)
GraphQL authentication for your headless Craft CMS applications.
Provides an add-on purchasable entity.
Drupal integration module for the Kalastatic prototyping and styleguide tool
Provides a base set of configuration and module dependencies for starting new Drupal projects.
统计信息
- 总下载量: 320.24k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 25
- 点击次数: 18
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: LGPL-2.1
- 更新时间: 2018-09-09