mopa / wsse-authentication-bundle
此包最新版本(dev-master)没有提供许可信息。
将 WSSE 身份验证简单易行地集成到 Symfony2 应用中的方法
dev-master
2013-06-16 11:02 UTC
Requires
- kriswallsmith/buzz: >=v0.9
- symfony/symfony: >=2.1.0
This package is auto-updated.
Last update: 2024-09-19 11:19:35 UTC
README
MopaWSSEAuthentication 包是将 WSSE 身份验证简单易行地集成到 Symfony2 应用中的方法
安装
app/autoload.php
$loader->registerNamespaces(array(
//other namespaces
'Mopa' => __DIR__.'/../vendor/bundles',
));
app/AppKernel.php
public function registerBundles()
{
return array(
//other bundles
new Mopa\Bundle\WSSEAuthenticationBundle\MopaWSSEAuthenticationBundle(),
);
...
配置
app/config/config.yml
# Mopa Rackspace Cloud Files configuration
mopa_wsse_authentication:
provider_class: Mopa\Bundle\WSSEAuthenticationBundle\Security\Authentication\Provider\WsseAuthenticationProvider
listener_class: Mopa\Bundle\WSSEAuthenticationBundle\Security\Firewall\WsseListener
factory_class: Mopa\Bundle\WSSEAuthenticationBundle\Security\Factory\WsseFactory
使用示例
app/config/security.yml
nonce_dir: 保存非ces的位置(使用null跳过nonce验证) lifetime: nonce提供者的生命周期 provider: wsse的用户提供者,可选,如果没有设置,将使用配置的第一个用户提供者
firewalls:
wsse_secured:
pattern: ^/api/.*
wsse:
nonce_dir: null
lifetime: 300
provider: my_user_provider
factories:
- "%kernel.root_dir%/../vendor/bundles/Mopa/WSSEAuthenticationBundle/Resources/config/security_factories.yml"
陷阱 / 已加密的密码
如果你没有使用明文编码器,用户必须提供的密码是从 $user->getPassword() 获取的密码(对于明文,这是相同的!)。如果你在一个使用 https 加密的网站上提供它,用于复制/写下它,这应该是一个安全的方法!WSSE 加密方式是安全的,即使提供明文密码,因此使用已加密的密码并不被认为更不安全。
例如,如果你使用 FOSUserBundle 及其用户提供者作为 WSSEAuthenticationBundle 的提供者,就会是这样的情况。