title: Secure area in Symfony2
body: <p>I have a question to the security features of Symfony2. I want to protect a special area of my application under the <code>/my</code> prefix.</p>
  
  <p>My configuration looks like follows:</p>
  
  <pre><code>security.config:
      providers:
          my:
              entity: { class: MyUserBundle:User, property: username }
  
      firewalls:
          public:
              pattern: /my/login.*
              security: false
  
          my:
              pattern: /my.*
              form-login:
                  check_path: /my/login_check
                  login_path: /my/login
              logout: true
  
      access_control:
          - { path: /my/login.*, roles: IS_AUTHENTICATED_ANONYMOUSLY }
  </code></pre>
  
  <p>When I try to access the login area, everything works fine, submitting the form leads to an error page, because there is no registered controller for the <code>_security_check</code> route, like its described in the <a href="http://docs.symfony-reloaded.org/master/guides/security/authentication.html#form-based-authentication" rel="nofollow">guide</a>:</p>
  
  <pre><code>_security_login:
      pattern: /my/login
      defaults: { _controller: MyUserBundle:Auth:login }
  
  _security_check:
      pattern: /my/login_check
  </code></pre>
  
  <p>I think normally the SecurityBundle hacks into this process so that no controller is needed. The configuration of Symfony2 is allways very complex.</p>
  
  <p>I think I missed something, hope you can help.<br />
  Thanks in advance!</p>