lutskanu/wsse-authentication-bundle
Composer 安装命令:
composer require lutskanu/wsse-authentication-bundle
包简介
Symfony2 bundle to implement WSSE authentication
关键字:
README 文档
README
Introduction
The EscapeWSSEAuthentication bundle is a simple and easy way to implement WSSE authentication in Symfony applications
Installation
Command Line
composer require escapestudios/wsse-authentication-bundle
composer.json
"require": { ... "escapestudios/wsse-authentication-bundle": "^2.2", ... }
app/AppKernel.php
public function registerBundles() { return array( //... new Escape\WSSEAuthenticationBundle\EscapeWSSEAuthenticationBundle(), //... ); ...
Commands
Delete expired nonces via the escape:wsseauthentication:nonces:delete command that ships with this bundle; it takes the firewall name as a (required) parameter.
php app/console --env=dev escape:wsseauthentication:nonces:delete wsse_secured
Quick usage example
app/config/security.yml
firewalls: wsse_secured: pattern: ^/api/.* stateless: true wsse: realm: "Secured with WSSE" #identifies the set of resources to which the authentication information will apply (WWW-Authenticate) profile: "UsernameToken" #WSSE profile (WWW-Authenticate)
...that's it! Your "wsse_secured"-firewall is now secured via the (out-of-the-box) WSSE Authentication setup. You can now start calling your API endpoints: generate a X-WSSE header (Symfony\Component\Security\Core\Encoder\MessageDigestPasswordEncoder) and add it to your request (cUrl). It is strongly recommended to have a read through the more advanced configuration below once you're up and running with the basics...
Advanced configuration
Specify a custom token lifetime
Default value: 300
app/config/security.yml
firewalls: wsse_secured: #... wsse: #... lifetime: 300 # or -1 for infinite lifetime tokens (please use with extreme care!)
Specify a custom date format
Default value: see regular expression below for ISO8601 (check out)
app/config/security.yml
firewalls: wsse_secured: #... wsse: #... date_format: '/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24\:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/'
Specify a custom digest algorithm
Default value: base 64-encoded sha1 with 1 iteration
⚠️ Please change the digest algorithm to a stronger one, like bcrypt ⚠️
app/config/security.yml
firewalls: wsse_secured: #... wsse: #... encoder: #digest algorithm algorithm: sha1 encodeHashAsBase64: true iterations: 1
Specify a custom nonce cache
Default value: Doctrine\Common\Cache\PhpFileCache in %kernel.cache_dir%/security/nonces
app/config/security.yml
services: #... cache_nonces: class: Doctrine\Common\Cache\PhpFileCache arguments: [%kernel.cache_dir%/security/nonces]
app/config/security.yml
firewalls: wsse_secured: #... wsse: #... nonce_cache_service_id: cache_nonces
Use multiple providers
app/config/security.yml
providers: provider_one: #... provider_two: #... firewalls: wsse_secured_by_provider_one: provider: provider_one wsse: #... wsse_secured_by_provider_two: provider: provider_two wsse: #...
Make use of a specific user provider on a firewall with WSSE as one of multiple authentication mechanisms
app/config/security.yml
providers: users: #... wsse_users: memory: users: - { name: 'someuser', password: 'somesecret' } firewalls: secured: provider: users wsse: #... provider: wsse_users #don't make use of firewall's "users"-provider, but "wsse_users"-provider for WSSE
Specify custom authentication class(es)
app/config/config.yml
# Escape WSSE authentication configuration escape_wsse_authentication: authentication_provider_class: Escape\WSSEAuthenticationBundle\Security\Core\Authentication\Provider\Provider authentication_listener_class: Escape\WSSEAuthenticationBundle\Security\Http\Firewall\Listener authentication_entry_point_class: Escape\WSSEAuthenticationBundle\Security\Http\EntryPoint\EntryPoint authentication_encoder_class: Symfony\Component\Security\Core\Encoder\MessageDigestPasswordEncoder
lutskanu/wsse-authentication-bundle 适用场景与选型建议
lutskanu/wsse-authentication-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 259 次下载、GitHub Stars 达 0, 最近一次更新时间为 2016 年 02 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「Authentication」 「bundle」 「wsse」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 lutskanu/wsse-authentication-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 lutskanu/wsse-authentication-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 lutskanu/wsse-authentication-bundle 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Guzzle plugin to manage WSSE authentication
Automatically logs-in users if they are already authenticated by a remote source. (e.g. environment variable REMOTE_USER)
Buzz plugin to manage WSSE authentication
2lenet/EasyAdminPlusBundle
GraphQL authentication for your headless Craft CMS applications.
The bundle for easy using json-rpc api on your project
统计信息
- 总下载量: 259
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 9
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-02-09