Skip to content

Instantly share code, notes, and snippets.

@wouterj
Created May 30, 2016 18:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save wouterj/80f3264f7e92eed3c9b9e621b6142228 to your computer and use it in GitHub Desktop.
Save wouterj/80f3264f7e92eed3c9b9e621b6142228 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: 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