title: error while integrating FOSUserBundle with FOSOAuthServer
body: <p>I am trying to integrate <code>FOSUserBundle</code> with <code>FOSOAuthServerBundle</code> to proect my <code>RESTFul APIs</code> but i am getting following error while accessing login page , i am quite new to it so i dont know how to get rid off this error.</p>
  
  <p>here i am trying to open a login form of <code>FOSUserBundle</code> so that i can login into it and get the Token </p>
  
  <p><img src="https://i.stack.imgur.com/upqVM.png" alt="enter image description here"></p>
  
  <p>here is my <code>security.yml</code></p>
  
  <pre><code># FOR FOSUserBundle 
  
  security:
  
      providers:
          fos_userbundle:
              id: fos_user.user_provider.username
  
      encoders:
          "FOS\UserBundle\Model\UserInterface": sha512
  
      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 }
  
      role_hierarchy:
          ROLE_ADMIN:       ROLE_USER
          ROLE_SUPER_ADMIN: ROLE_ADMIN
  
  
  # FOR FOSOAuthServerBundle 
  
  security:
      providers:
          fos_userbundle:
              id: fos_user.user_provider.username
      firewalls:
          oauth_token:
              pattern:    ^/oauth/v2/token
              security:   false
  
  
          oauth_authorize:
              pattern:    ^/oauth/v2/auth
              form_login:
                   provider: fos_userbundle
                   check_path: /oauth/v2/auth/login_check
                   login_path: /oauth/v2/auth/login
              anonymous: true
              # Add your favorite authentication process here
  
          api:
              pattern:    ^/api
              fos_oauth:  true
              stateless:  true
              anonymous: true # can be omitted as its default value
  
      access_control:
             - { path: ^/api, roles: [ IS_AUTHENTICATED_FULLY ] }
  </code></pre>