bburnichon / bbn-security-bundle
此包已废弃且不再维护。未建议替代包。
基于简单Api Key的认证Bundle,适用于Symfony2
v0.1.0
2013-10-15 17:04 UTC
Requires
- php: >=5.3.3
- symfony/dependency-injection: ~2.3
- symfony/http-kernel: ~2.3
- symfony/security: ~2.3
- symfony/security-bundle: ~2.3
Requires (Dev)
This package is auto-updated.
Last update: 2022-02-01 12:27:44 UTC
README
基于Api Key的认证Bundle,适用于Symfony2
使用方法
此Bundle将启用新的api_key认证提供者
在您的security.yml文件中按以下方式使用
security: firewall: your-firewall-name: pattern: ^/what-you-wish-to-protect/ provider: user_provider_name api_key: parameter: apikey stateless: true
新的用户提供者应将api key作为用户名
将使用提供的api key调用loadUserFromUsername()
方法,认证类不关心凭证字段
安装
$ composer require bburnichon/bbn-security-bundle:@dev
然后添加以下内容到您的AppKernel
$bundles = array( new BBn\SecurityBundle\BBnSecurityBundle(), );
运行测试
$ php bin/phpunit
许可证
bbn-security-bundle在MIT许可证下发布。有关详细信息,请参阅捆绑的LICENSE文件。