0

I want to generate a bundle in symfony2 with the following command:

php app/console generate:bundle --namespace=MyApp/SecurityBundle --format=yml

but when running this command I get the following error:

[Symfony\Component\Config\Definition\Exception\InvalidConfigurationException]
The child node "providers" at path "security" must be configured.

I just started learning symfony. I can not figure out why I get this? is SecurityBundle is a reserved name? I read in symfony tutorial where there was a bundle named AcmeSecurityBundle, If it is a reserved name and I can not use it how the AcmeSecurityBundle is created? I don't have any problem in creating a bundle in other names.

Here's my app/config/security.yml content:

security:
    firewalls:
        secured_area:
            pattern:    ^/
            anonymous:  ~
            form_login:
                login_path:     login
                check_path:     login_check
5
  • are you using the symfony standard edition? Commented Feb 25, 2014 at 8:50
  • Yes I downloaded Symfony_standard with vendors Commented Feb 25, 2014 at 8:51
  • can you post your app/config/security.yml content? Commented Feb 25, 2014 at 8:52
  • @JamesHalsall I just did it Commented Feb 25, 2014 at 8:54
  • 2
    configure provider in the security section Commented Feb 25, 2014 at 8:57

1 Answer 1

1

You need provider in security.yml like:

providers:
    in_memory:
        memory:
            users:
                user: { password: userpass, roles: [ 'ROLE_USER' ] }
                admin: { password: adminpass, roles: [ 'ROLE_ADMIN' ] }

Check out default security.yml.

Sign up to request clarification or add additional context in comments.

1 Comment

I founded that I also have to define ROLE_USER and ROLE_ADMIN roles

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.