Symfony FOSOAuthServerBundle: access token not detected Symfony FOSOAuthServerBundle: access token not detected symfony symfony

Symfony FOSOAuthServerBundle: access token not detected


I finally found what was causing the problem. I had a firewall that was nullifying the other firewall, because of same patterns:

security:[...]    firewalls:        other_firewall: #this one            pattern:    ^/            anonymous:  true        api:            pattern:    ^/api            fos_oauth:  true            stateless:  true            anonymous:  true

I also think that an authentication made in one firewall is not available in an other firewall, so diminishing the number of firewalls to the strict minimum (one not secured, one with auth etc.) is a good practice. Then using access_control for fine access.