simplesamlphp/simplesamlphp-module-memcookie
Composer 安装命令:
composer require simplesamlphp/simplesamlphp-module-memcookie
包简介
A SimpleSAMLphp module that allows integration with Auth MemCookie, allowing web applications written in other languages than PHP to integrate with SimpleSAMLphp.
README 文档
README
This module implements Auth MemCookie support for SimpleSAMLphp. This allows you to integrate SimpleSAMLphp with web applications written in languages other than PHP.
AuthMemCookie works by reading authentication data from a memcache server and setting environment variables based on the attributes found in this data. It also allows you to use the default Apache access control features to restrict access to your site.
Requisites
This module requires you to install and set up the following requirements:
- SimpleSAMLphp running as a Service Provider.
- A memcache server.
- Auth MemCookie .
Installation
Once you have installed SimpleSAMLphp, installing this module is very simple. First of all, you will need to download Composer if you haven't already. After installing Composer, just execute the following command in the root of your SimpleSAMLphp installation:
composer.phar require simplesamlphp/simplesamlphp-module-memcookie:dev-master
where dev-master instructs Composer to install the master branch from the Git repository. See the
releases available if you want to use a
stable version of the module.
Configuration
Next thing you need to do is to enable the module:
in config.php, search for the module.enable key and set memcookie to true:
'module.enable' => [ 'memcookie' => true, … ],
The first step to use this module is to configure Auth MemCookie appropriately. The following example (that you can
find also in extra/auth_memcookie.conf) might be helpful:
<Location /> # This is a list of memcache servers which Auth MemCookie # should use. # Note that this list must list the same servers as the # 'authmemcookie.servers'-option in config.php in the # configuration for simpleSAMLphp. # # The syntax for this option is inherited from: http://docs.libmemcached.org/libmemcached_configuration.html Auth_memCookie_Memcached_Configuration "--SERVER=127.0.0.1:11211" # This must be set to 'on' to enable Auth MemCookie for # this directory. Auth_memCookie_Authoritative on # This adjusts the maximum number of data elements in the # session data. The default is 10, which can be to low. Auth_memCookie_SessionTableSize "40" # These two commands are required to enable access control # in Apache. AuthType Cookie AuthName "My Login" # This command causes apache to redirect to the given # URL when we receive a '401 Authorization Required' # error. We redirect to "/simplesaml/module.php/memcookie/auth.php", # which initializes a login to the IdP. ErrorDocument 401 "/simplesaml/module.php/memcookie/auth.php" </Location> <Location /protected> # This allows all authenticated users to access the # directory. To learn more about the 'Require' command, # please look at: # http://httpd.apache.org/docs/2.0/mod/core.html#require Require valid-user </Location>
Once Auth MemCookie has been correctly configured, you need to configure the module itself by editing the
config/authmemcookie.php file. Set the username configuration option to the name of an attribute that you are sure
to receive and that will identify the user unambiguously. Read the instructions in the file itself if you need help to
configure it.
If you already have an auth source configured and working in SimpleSAMLphp, and all your memcookie configuration options are correct, you are ready to go! Make sure to reload Apache so that it uses the new configuration and Auth MemCookie is loaded. Then you can point your browser to the location that you have protected in Apache and it should redirect you automatically to the IdP for authentication.
In order to see all the environment variables you have available in the protected location, you can drop a PHP script like the following in there and access it from your browser after authenticating to your IdP:
<html> <body> <table> <?php foreach ($_SERVER as $key => $value) { echo " <tr><td>".htmlspecialchars($key)."</td><td>".htmlspecialchars($value)."</td></tr>\n"; } ?> </table> </body> </html>
simplesamlphp/simplesamlphp-module-memcookie 适用场景与选型建议
simplesamlphp/simplesamlphp-module-memcookie 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 6.46M 次下载、GitHub Stars 达 5, 最近一次更新时间为 2016 年 02 月 18 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「cookies」 「apache」 「simplesamlphp」 「Auth MemCookie」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 simplesamlphp/simplesamlphp-module-memcookie 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 simplesamlphp/simplesamlphp-module-memcookie 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 simplesamlphp/simplesamlphp-module-memcookie 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A SimpleSAMLphp module for using Redis for session storage etc.
This package includes a script and fail2ban configuration that allows you to use fail2ban when utilizing AWS elastic load balancer (ELB) and an apache webserver.
PHP library to parse Apache log files
PHP polyfill for the Apache Functions. The aim is to provides functions as the PHP way in order to get them available even if PHP is not running as an Apache module.
A SimpleSAMLPHP module for authorize working with module Perun
SSP Module of various filters developed by Cirrus Identity
统计信息
- 总下载量: 6.46M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 21
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: LGPL-2.1
- 更新时间: 2016-02-18