alcalyn / symfony-wsse
基于 Symfony 文档中的示例实现的 WSSE 实现。
1.1.0
2017-09-26 15:34 UTC
Requires
- php: >=5.3.2
- symfony/http-foundation: ~2.3|3.0.*
- symfony/http-kernel: ~2.3|3.0.*
- symfony/security: ~2.3|3.0.*
This package is not auto-updated.
Last update: 2024-09-14 17:42:57 UTC
README
这个库提供了在 Symfony 文档中使用的类,关于 WSSE 实现。
安装
通过 Composer
{ "require": { "alcalyn/symfony-wsse": "~1.0.0" } }
使用方法
您必须在您的 Symfony 项目中注册库类。
Silex
参见 SilexWSSE 项目。
Symfony 全栈
注册服务
# app/config/services.yml services: wsse.security.authentication.provider: class: Alcalyn\Wsse\Security\Authentication\Provider\WsseProvider arguments: - "" # User Provider - "%kernel.cache_dir%/security/nonces" public: false wsse.security.authentication.listener: class: Alcalyn\Wsse\Security\Firewall\WsseListener arguments: ["@security.token_storage", "@security.authentication.manager"] public: false
注册您的 WSSE 安全上下文
// src/AppBundle/AppBundle.php namespace AppBundle; use Symfony\Component\HttpKernel\Bundle\Bundle; use Symfony\Component\DependencyInjection\ContainerBuilder; use Alcalyn\Wsse\DependencyInjection\Security\Factory\WsseFactory; class AppBundle extends Bundle { public function build(ContainerBuilder $container) { parent::build($container); $extension = $container->getExtension('security'); $extension->addSecurityListenerFactory(new WsseFactory()); } }
现在您可以在项目中使用 WSSE 安全了
# app/config/security.yml security: # ... firewalls: wsse_secured: pattern: ^/api/ stateless: true wsse: true
许可证
本项目采用 MIT 许可证。