dependency injection - Symfony 2.3 FOSUserBundle does not find security.context -


i installed fos bundle mentioned in: https://github.com/friendsofsymfony/fosuserbundle/blob/master/resources/doc/index.md

after installation composer , setting user class get:

[symfony\component\dependencyinjection\exception\servicenotfoundexception]  service "fos_user.security.login_manager" has dependency on non-exi  stent service "security.context". 

i checked existence of path , there contextinterface included in fosuserbundle... using console aborts same error. anyone?

i enabled bundle in appkernel (where security bundle activated):

        ...         new symfony\bundle\securitybundle\securitybundle(),         ...         new fos\userbundle\fosuserbundle(),         ... 

i added config config.yml:

# fos userbundle config fos_user:     db_driver: orm     firewall_name: main     user_class: sddb\mainbundle\entity\user 

i extended routing.yml:

# user auth stuff  fos_user_security:     resource: "@fosuserbundle/resources/config/routing/security.xml"  fos_user_profile:     resource: "@fosuserbundle/resources/config/routing/profile.xml"     prefix: /profile  fos_user_register:     resource: "@fosuserbundle/resources/config/routing/registration.xml"     prefix: /register  fos_user_resetting:     resource: "@fosuserbundle/resources/config/routing/resetting.xml"     prefix: /resetting  fos_user_change_password:     resource: "@fosuserbundle/resources/config/routing/change_password.xml"     prefix: /profile 

and security.yml:

security: encoders:     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  firewalls:     main:         pattern: ^/         form_login:             provider: fos_userbundle             csrf_provider: form.csrf_provider         logout:       true         anonymous:    true  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 } 

ok found solution of developer of fos bundle.

if have simmilar problem go through basic stuff:

  1. is fos bundle version fitting symfony version?
  2. is security bundle proper installed?
  3. is activated in appkernel?
  4. is there configuration file (security.yml)?
  5. is inlcuded in (main)config.yml?

i had dumb typo in include line @ point (4)...


Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

jquery - How would i go about shortening this code? And to cancel the previous click on click of new section? -