Skip to content

Instantly share code, notes, and snippets.

@kokers
Forked from wouterj/security.yml
Last active May 30, 2016 18:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kokers/f20cfbe9e4a6b5355bbcdf56a7432ca1 to your computer and use it in GitHub Desktop.
Save kokers/f20cfbe9e4a6b5355bbcdf56a7432ca1 to your computer and use it in GitHub Desktop.
security:
encoders:
AppBundle\Entity\User:
algorithm: pbkdf2
hash_algorithm: sha512
encode_as_base64: true
iterations: 1000
# http://symfony.com/doc/current/book/security.html#where-do-users-come-from-user-providers
providers:
our_db_provider:
entity:
class: AppBundle:User
property: username
firewalls:
# disables authentication for assets and the profiler, adapt it according to your needs.
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main:
pattern: ^/
provider: our_db_provider
anonymous: ~
form_login:
login_path: /login
check_path: /login
access_control:
- { path: ^/(login|register), roles: IS_AUTHENTICATED_ANONYMOUSLY } # or whatever roles you use
- { path: ^/, roles: ROLE_USER } # or whatever roles you use
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment