title: How to configure FOSUserBundle to be the authentication provider for my FOSOAuthServerBundle enabled server
body: <p>I am trying to set up <code>FOSUserBundle</code> to be the authentication provider for my <code>FOSOAuthServerBundle</code> enabled server. The <code>FOSOAuthServerBundle</code> has been working correctly prior to me trying to implement <code>FOSUserBundle</code> and I have also had <code>FOSUserBundle</code> working without <code>FOSOAuthServerBundle</code>, but I just can't get them working together.</p>
  
  <p>My question is what should be specified for the authentication provider in the <code>oauth_authorize</code>: firewall in the <code>security.yml</code> below?</p>
  
  <pre><code># app/config/security.yml
  security:
      providers:
      fos_userbundle:
          id: fos_user.user_provider.username
  
      encoders:
          FOS\UserBundle\Model\UserInterface: sha512
  
      firewalls:
          oauth_token:
              pattern:    ^/oauth/v2/token
              security:   false
  
          oauth_authorize:
              pattern:    ^/oauth/v2/auth
  
              # WHAT GOES HERE?
  
          api:
              pattern:    ^/api
              fos_oauth:  true
              stateless:  true
  
      access_control:
          - { path: ^/api, roles: [ IS_AUTHENTICATED_FULLY ] }
  </code></pre>
  
  <p>I am trying to authenticate the users and not the client. </p>
  
  <p>Many thanks.</p>