Symfony2 纯文本用户不工作 [英] Symfony2 plaintext users don't work
本文介绍了Symfony2 纯文本用户不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我尝试通过将其配置到 secury.yml 来配置一个简单的安全管理区域.我用了 Symfony 的例子:
I tried to configure a simple secured admin area by configuring it into secury.yml. I used the example of Symfony :
security:
firewalls:
secured_area:
pattern: ^/
anonymous: ~
http_basic:
realm: "Secured Admin Area"
access_control:
- { path: ^/admin, roles: ROLE_ADMIN }
providers:
in_memory:
users:
ryan: { password: ryanpass, roles: 'ROLE_USER' }
admin: { password: kitten, roles: 'ROLE_ADMIN' }
encoders:
Symfony\Component\Security\Core\User\User: plaintext
我有用户名/密码提示,但 ryan:ryanpass 和 admin:kitten 这对夫妇不起作用.有什么问题吗?
I have the username / password prompt, but the couples ryan:ryanpass and admin:kitten doesn't work. Is there something wrong ?
谢谢
推荐答案
我认为您需要在您的情况下将提供者名称添加到 http_basic 部分:
I think you need to add the provider name to the http_basic section in your case:
http_basic:
realm: "Secured Admin Area"
provider: in_memory
这篇关于Symfony2 纯文本用户不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文