Skip to content

Instantly share code, notes, and snippets.

@arghav
Created January 27, 2011 12:02
Show Gist options
  • Select an option

  • Save arghav/798420 to your computer and use it in GitHub Desktop.

Select an option

Save arghav/798420 to your computer and use it in GitHub Desktop.
security.yml
###FORM_LOGIN_AUTH
security.config:
encoders:
Symfony\Component\Security\User\User: plaintext
providers:
main:
users:
foo: { password: bar, roles: ROLE_USER }
firewalls:
login: { pattern: /login, security: true, anonymous: true }
login_check: { pattern: /login_check, security: true, anonymous: true, form_login: true }
profiler: { pattern: /_profiler.*, security: true, anonymous: true }
main:
pattern: /admin.*
form_login: { check_path: /login_check }
logout: { path: /logout, target: /login }
anonymous: true
public:
pattern: .*
anonymous: true
logout: { path: /logout, target: /login }
access_control:
- { path: /admin.*, role: [ ROLE_USER ] }
- { path: .*, role: IS_AUTHENTICATED_ANONYMOUSLY }
####HTTP_BASIC AUTH
security.config:
encoders:
Symfony\Component\Security\User\User: plaintext
providers:
main:
users:
foo: { password: bar, roles: ROLE_USER }
firewalls:
profiler: { pattern: /_profiler.*, security: true, anonymous: true }
main:
pattern: /admin.*
http_basic: true
anonymous: true
public:
pattern: .*
anonymous: true
access_control:
- { path: /admin.*, role: [ ROLE_USER ] }
- { path: .*, role: IS_AUTHENTICATED_ANONYMOUSLY }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment