atwx/silverstripe-gate-client
Composer 安装命令:
composer require atwx/silverstripe-gate-client
包简介
A Silverstripe module to allow you to log into any of your Silverstripe sites from one place.
README 文档
README
A SilverStripe module that lets you log into a SilverStripe site from a centralized system using signed JWTs and then redirects you into the CMS.
In short: the module validates a signed JSON Web Token (JWT) passed via the URL. On successful validation a configured user (or the default admin) is automatically logged in and redirected to a configured destination URL.
Use the Silverstripe Gate Manager on your admin instance to do so.
Installation
This package is intended to be installed via Composer. From your project root:
composer require atwx/silverstripe-gate-client
Configuration
Configure the module via SilverStripe YAML config. Important options:
Atwx\SilverGateClient\Services\TokenService: public_key: | -----BEGIN PUBLIC KEY----- ... -----END PUBLIC KEY----- # Login as admin is default Atwx\SilverGateClient\Services\LoginService: # Finds the current default admin or creates one if none exists login_as_default_admin: true #member_id: 1 #member_email: xyz@example.com
Note: the key must be in PEM format. Tokens should be signed by the central system that issues them with the corresponding private key (for example RS256).
You can also use the .env to configure the public key. Make sure to escape newlines using \n:
SILVERGATECLIENT_PUBLIC_KEY="-----BEGIN PUBLIC KEY-----\n...\n-----END PUBLIC KEY-----"
More advanced configuration:
Atwx\SilverGateClient\Services\TokenService: public_key: | -----BEGIN PUBLIC KEY----- ... -----END PUBLIC KEY----- # defaults to 60, specifies how old the token is allowed to be before it is invalidated token_max_age_seconds: 60 Atwx\SilverGateClient\Services\LoginService: member_id: 1 login_dest: '/custom-url-after-login'
Sudo Mode
By default, SilverStripe's Sudo Mode is not activated after a JWT login. This means users who access sudo-protected CMS areas (e.g. certain security settings) will be prompted for their password — which is not possible for SSO users.
You can opt in to automatically bypassing sudo mode for JWT-authenticated sessions:
Via .env:
SILVERGATECLIENT_DISABLE_SUDO_MODE=1
Via YAML:
Atwx\SilverGateClient\Services\LoginService: disable_sudo_mode: true
When enabled, a jwt-authenticated flag is set in the session after a successful JWT login. A SudoModeExtension on SudoModeService detects this flag and marks sudo mode as active for the duration of the session.
Security considerations:
- The feature is opt-in and disabled by default.
- The session flag is only set after JWT signature validation and a successful member login.
- The flag is cleared when the user logs out (session is destroyed).
- Unlike normal sudo mode (which times out after 45 minutes), the bypass is active for the entire session. This is intentional for SSO users who cannot enter a password.
Route / Endpoint
The module registers the route /_silvergateclient (see _config/routes.yml).
Primary endpoint:
- GET
/_silvergateclient/token/<urlencoded_base64_jwt>
Example (as used in the tests):
$token = JWT::encode(['iat' => time()], $privateKey, 'RS256'); $b64 = urlencode(base64_encode($token)); // GET /_silvergateclient/token/<$b64>
atwx/silverstripe-gate-client 适用场景与选型建议
atwx/silverstripe-gate-client 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.33k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 02 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「module」 「cms」 「login」 「management」 「silverstripe」 「sites」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 atwx/silverstripe-gate-client 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 atwx/silverstripe-gate-client 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 atwx/silverstripe-gate-client 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
WeChat OAuth SDK
GraphQL authentication for your headless Craft CMS applications.
Debugging a problem and need to login as one of your customers? This allows you to authenticate as any of your customers.
Set Links with a specific language parameter
Supercharged text field validation.
Integrate with Snipcart.
统计信息
- 总下载量: 1.33k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 7
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2026-02-05