1
上的Symfony2 FOSUserBundle授權令牌錯誤我要去gcrazy!登錄屏幕
我剛纔集成FOSUserBundle到我的Symfony2項目,我現在得到的登錄屏幕上的錯誤。
在FOSUserBundle :: layout.html中呈現模板期間(「安全上下文不包含身份驗證令牌,一種可能的原因可能是沒有爲此URL配置防火牆」)引發異常。小枝在8行
我Security.yml
security:
encoders:
Symfony\Component\Security\Core\User\User: plaintext
FOS\UserBundle\Model\UserInterface: sha512
role_hierarchy:
ROLE_ADMIN: ROLE_USER
ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
providers:
fos_userbundle:
id: fos_user.user_provider.username
#entity: {class Smada\Agenda7Bundle\Entity\User, property: username}
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
login:
pattern: ^/login$
security: false
main:
pattern: ^/
form_login:
provider: fos_userbundle
csrf_provider: form.csrf_provider
logout: true
anonymous: false
# secured_area:
# pattern: ^/demo/secured/
# form_login:
# check_path: _security_check
# login_path: _demo_login
# logout:
# path: _demo_logout
# target: _demo
access_control:
- { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/admin/, role: ROLE_ADMIN }
而且我config.yml有這它
fos_user:
db_driver: propel # other valid values are 'mongodb', 'couchdb' and 'propel'
firewall_name: main
user_class: Smada\Agenda7\Entity\User
有誰知道我的問題是什麼? 在此先感謝!
感謝,雖然它似乎沒有有所作爲。我只是刪除FOSUser捆綁並重新安裝,似乎現在的工作 – Adam
@Adam和你保持登錄防火牆呢? – WebHQ