I am trying to set up FOSUserBundle
to be the authentication provider for my FOSOAuthServerBundle
enabled server. The FOSOAuthServerBundle
has been working correctly prior to me trying to implement FOSUserBundle
and I have also had FOSUserBundle
working without FOSOAuthServerBundle
, but I just can't get them working together.
My question is what should be specified for the authentication provider in the oauth_authorize
: firewall in the security.yml
below?
# 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 ] }
I am trying to authenticate the users and not the client.
Many thanks.