Próbuję zainstalować najnowsze FosUserBundle do Symfony 2.6.6
Robię wszystko tak jak jest opisane w instrukcji do instalacji pakietu,ale w momencie aktualizacji struktury bazy danych
Wyskakuje błąd:
unrecognized option "csrf_provider" under "security.firewalls.user"
Poniżej przedstawiam zawartość security.yml:
# you can read more about security in the related section of the documentation
security:
encoders:
Symfony\Component\Security\Core\User\User: plaintext
FOS\UserBundle\Model\UserInterface: sha512
role_hierarchy:
ROLE_ADMIN: ROLE_USER
ROLE_SUPER_ADMIN: ROLE_ADMIN
providers:
fos_userbundle:
id: fos_user.user_provider.username
# the main part of the security, where you can set up firewalls
# for specific sections of your app
firewalls:
user:
pattern: ^/
form_login:
provider:
fos_userbundle
csrf_provider:
security.csrf.token_manager # Use form.csrf_provider instead for Symfony <2.4
logout: true
#path: logout
#target: _demo
anonymous: true
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
login:
pattern: ^/demo/secured/login$
security: false
secured_area:
pattern: ^/demo/secured/
form_login:
check_path: _security_check
login_path: _demo_login
logout:
path: _demo_logout
target: _demo
# disables authentication for assets and the profiler, adapt it according to your needs
# the login page has to be accessible for everybody
# secures part of the application
#http_basic:
# realm: "Secured Demo Area"
# with these settings you can restrict or allow access for different parts
# of your application based on roles, ip, host or methods
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 }
i config.yml:
framework:
#esi: ~
translator: ~
secret: "%secret%"
router:
resource: "%kernel.root_dir%/config/routing.yml"
strict_requirements: ~
form: ~
csrf_protection: ~
validation: { enable_annotations: true }
templating:
engines: ['twig']
#assets_version: SomeVersionScheme
default_locale: "%locale%"
trusted_hosts: ~
trusted_proxies: ~
session:
# handler_id set to null will use default session handler from php.ini
handler_id: ~
fragments: ~
http_method_override: true
Próbowałem zmienić wartosc framework.csrf_protection na enable: true ale to nic nie dało.
Wydaje mi się że problem leży przy wpisaniu poprawnej wartośći do csrf_provider, niestety nie wiem jaka to jest.
Ten post edytował Crash89 5.06.2015, 18:15:17