Commit e285fc71 authored by wilhelmhb's avatar wilhelmhb

security configuration

parent d8a23c57
# you can read more about security in the related section of the documentation
# http://symfony.com/doc/current/book/security.html
security:
# http://symfony.com/doc/current/book/security.html#encoding-the-user-s-password
encoders:
ApiBundle\Entity\PsCustomer:
algorithm: md5
iterations: 0
encode_as_base64: false
#ApiBundle\Entity\Membres: sha1
# http://symfony.com/doc/current/book/security.html#hierarchical-roles
role_hierarchy:
ROLE_ADMIN: ROLE_USER
ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
# http://symfony.com/doc/current/book/security.html#where-do-users-come-from-user-providers
providers:
# in_memory:
# memory:
# users:
# user: { password: $2a$12$Epmi2uGZ8sdk6H.TmgPBdOZzgGk7/i5tsr8j4dWAdEkLcM.n.f3QW, roles: [ 'ROLE_USER' ] }
# admin: { password: $2a$12$oKHYGNTsa7/MSFD1GhpX2uaL0VUG7HFw0sVsJN.oJr.TvSU2qSXTu, roles: [ 'ROLE_ADMIN' ] }
our_db_provider:
entity:
class: ApiBundle:PsCustomer
# property: pseudo
# if you're using multiple entity managers
# manager_name: customer
# the main part of the security, where you can set up firewalls
# for specific sections of your app
firewalls:
# disables authentication for assets and the profiler, adapt it according to your needs
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
# the login page has to be accessible for everybody
demo_login:
pattern: ^/demo/secured/login$
security: false
# secures part of the application
demo_secured_area:
pattern: ^/demo/secured/
# it's important to notice that in this case _demo_security_check and _demo_login
# are route names and that they are specified in the AcmeDemoBundle
form_login:
check_path: _demo_security_check
login_path: _demo_login
logout:
path: _demo_logout
target: _demo
#anonymous: ~
#http_basic:
# realm: "Secured Demo Area"
# api
main:
pattern: ^/login.html$
anonymous: true
http_basic: ~
#provider: our_db_provider
create_user:
pattern: ^/pscustomer$
anonymous: true
http_basic: ~
secured:
pattern: ^/
entry_point : api.authenticationentrypoint
form_login:
success_handler: api.authenticationsuccess.handler
failure_handler: api.authenticationfailure.handler
login_path: login_route
check_path: login_check
logout:
path: logout
target: login_route
# with these settings you can restrict or allow access for different parts
# of your application based on roles, ip, host or methods
# http://symfony.com/doc/current/cookbook/security/access_control.html
access_control:
#- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY, requires_channel: https }
# you can read more about security in the related section of the documentation
# http://symfony.com/doc/current/book/security.html
security:
# http://symfony.com/doc/current/book/security.html#encoding-the-user-s-password
encoders:
ApiBundle\Entity\PsCustomer:
algorithm: md5
iterations: 0
encode_as_base64: false
# http://symfony.com/doc/current/book/security.html#hierarchical-roles
role_hierarchy:
ROLE_ADMIN: ROLE_USER
ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
# http://symfony.com/doc/current/book/security.html#where-do-users-come-from-user-providers
providers:
in_memory:
memory:
users:
user: { password: $2a$12$Epmi2uGZ8sdk6H.TmgPBdOZzgGk7/i5tsr8j4dWAdEkLcM.n.f3QW, roles: [ 'ROLE_USER' ] }
admin: { password: $2a$12$oKHYGNTsa7/MSFD1GhpX2uaL0VUG7HFw0sVsJN.oJr.TvSU2qSXTu, roles: [ 'ROLE_ADMIN' ] }
our_db_provider:
entity:
class: ApiBundle:PsCustomer
property: email
# if you're using multiple entity managers
# manager_name: customer
# the main part of the security, where you can set up firewalls
# for specific sections of your app
firewalls:
# disables authentication for assets and the profiler, adapt it according to your needs
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
# the login page has to be accessible for everybody
demo_login:
pattern: ^/demo/secured/login$
security: false
# secures part of the application
demo_secured_area:
pattern: ^/demo/secured/
# it's important to notice that in this case _demo_security_check and _demo_login
# are route names and that they are specified in the AcmeDemoBundle
form_login:
check_path: _demo_security_check
login_path: _demo_login
logout:
path: _demo_logout
target: _demo
#anonymous: ~
#http_basic:
# realm: "Secured Demo Area"
# api
main:
pattern: ^/login$
anonymous: true
http_basic: ~
provider: in_memory
secured:
pattern: ^/
form_login:
login_path: login_route
check_path: login_check
logout:
path: logout
target: login_route
# with these settings you can restrict or allow access for different parts
# of your application based on roles, ip, host or methods
# http://symfony.com/doc/current/cookbook/security/access_control.html
access_control:
#- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY, requires_channel: https }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment