需要Symfony2 http_digest防火墙配置示例
我想将 http_basic 更改为 http_digest 作为防火墙, 但并没有真正记录如何配置 http_digest。
参考似乎不完整或不是最新的:
http://symfony.com /doc/2.0/reference/configuration/security.html
http_basic:
provider: name
http_digest:
provider: name
然而,书中的示例使用领域而不使用提供程序。
http://symfony.com/doc/current/book/security.html
http_basic:
realm: "Secured Demo Area"
至少该示例有效,但是当我将 http_basic 更改为 http_digest 时,缺少(未记录的)密钥。
ErrorException: 注意: 未定义的索引: key in ..\vendor\symfony\src\Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\HttpDigestFactory.php line 80
http_digest:
realm: "Secured Demo Area"
key: "whatever"
添加密钥似乎有效,但登录后会导致另一个错误:
致命错误:调用未定义的方法 Symfony\Component\Security\Http\EntryPoint\DigestAuthenticationEntryPoint::getKey() 中..\vendor\symfony\src\Symfony\Component\Security\Http\Firewall\DigestAuthenticationListener.php 第 79 行
这就是我不知道我的配置中缺少什么的地方。 我只需要一个使用 Symfony 2 的 http_digest 的工作示例。
i want to change http_basic to http_digest for a firewall,
but it is not really documented how to configure http_digest.
There reference seems to be incomplete or not up to date:
http://symfony.com/doc/2.0/reference/configuration/security.html
http_basic:
provider: name
http_digest:
provider: name
The example in the book however use a realm and no provider.
http://symfony.com/doc/current/book/security.html
http_basic:
realm: "Secured Demo Area"
At least that example works but when i change http_basic to http_digest a (not documented) key is missing.
ErrorException: Notice: Undefined index: key in ..\vendor\symfony\src\Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\HttpDigestFactory.php line 80
http_digest:
realm: "Secured Demo Area"
key: "whatever"
Adding a key seems to work but after login leads to another error:
Fatal error: Call to undefined method Symfony\Component\Security\Http\EntryPoint\DigestAuthenticationEntryPoint::getKey() in ..\vendor\symfony\src\Symfony\Component\Security\Http\Firewall\DigestAuthenticationListener.php on line 79
Thats the point where i have no clue what is missing in my configuration.
I just need a working example for http_digest with Symfony 2.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这似乎在当前版本的 Symfony2 (2.0.10) 中得到了解决。
对我来说效果很好。
This seems to be resolved in current version of Symfony2 (2.0.10) .
Works for me fine.