Skip to content

Instantly share code, notes, and snippets.

@xphere
Created July 8, 2013 14:01
Show Gist options
  • Select an option

  • Save xphere/5949027 to your computer and use it in GitHub Desktop.

Select an option

Save xphere/5949027 to your computer and use it in GitHub Desktop.
Demonstrates how order matters in firewall setup #Symfony #Security
# With this security.yml, browsing to /api resolves to root firewall
security:
# ...
firewalls:
root:
pattern: ^/
anonymous: true
api:
pattern: ^/api
http_basic: ~
# With this one, same route resolves to the api one
security:
# ...
firewalls:
api:
pattern: ^/api
http_basic: ~
root:
pattern: ^/
anonymous: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment