silverstripe/realme
Composer 安装命令:
composer require silverstripe/realme
包简介
Adds support to SilverStripe for authentication via RealMe (https://www.realme.govt.nz/)
README 文档
README
Adds support to Silverstripe for authentication and identity assertion via RealMe.
This module provides the foundation to support a quick integration for a Silverstripe application with RealMe as an identity provider. This module requires extensive setup prior to being utilised effectively.
If integration with RealMe is wanted, it is best to get in touch with the RealMe team as early as possible. This can be accomplished by getting in touch with the RealMe team.
If you encounter any issues please open a new issue here.
Installation
composer require silverstripe/realme
Configuration of RealMe for your application
RealMe provide two testing environments and a production environment for you to integrate with. Access to these environments is strictly controlled, and more information on these can be found on the RealMe Developers site.
See configuration documentation for environment and YML configuration required before the module can be used.
Providing RealMe login buttons
By default, the module provides an Authenticator class in SilverStripe, adding a new login form. If you want to provide your own separate login form just for RealMe, then the built-in templates can help
with this. They have been designed to integrate as cleanly as possible with Silverstripe templates, but it is up to you
whether you use them, or roll your own.
See the templates documentation for more information on using or modifying these.
Testing for authentication
The RealMeService service object allows you to inject authentication where-ever it is required. For example, let's
take a simple Controller that ensures that all users have a valid RealMe 'FLT' (a unique string that identifies a RealMe
user, but is not their username):
use SilverStripe\Control\Controller; use SilverStripe\Control\HTTPRequest; use SilverStripe\RealMe\RealMeService; class RealMeTestController extends Controller { /** * @var RealMeService */ public $realMeService; private static $dependencies = array( 'realMeService' => '%$SilverStripe\RealMe\RealMeService' ); public function index(HTTPRequest $request) { // enforceLogin will redirect the user to RealMe if they're not authenticated, or return true if they are // authenticated with RealMe. It should only ever return 'false' if there was an error initialising config if($this->realMeService->enforceLogin($request)) { $userData = $this->realMeService->getUserData(); printf("Congratulations, you're authenticated with a unique ID of '%s'!", $userData->SPNameID); } else { echo "There was an error while attempting to authenticate you."; } } }
Appreciation
- Sincere thanks to Jackson (@jakxnz) for his work reviewing and updating pull requests.
silverstripe/realme 适用场景与选型建议
silverstripe/realme 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 136.66k 次下载、GitHub Stars 达 9, 最近一次更新时间为 2015 年 11 月 26 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「Authentication」 「silverstripe」 「saml」 「RealMe」 「Real Me」 「iGovt」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 silverstripe/realme 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 silverstripe/realme 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 silverstripe/realme 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
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.
Laravel middleware to restrict a site or specific routes using HTTP basic authentication
A Laravel package for Saml2 integration as a SP (service provider) for multiple IdPs, based on OneLogin toolkit which is much more lightweight than simplesamlphp.
Zend\Authentication SAML adapter. Uses existing simpleSAMLphp install.
统计信息
- 总下载量: 136.66k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 9
- 点击次数: 16
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2015-11-26