container1.xml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <srv:container xmlns="http://symfony.com/schema/dic/security"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xmlns:srv="http://symfony.com/schema/dic/services"
  5. xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
  6. <config>
  7. <acl />
  8. <encoder class="JMS\FooBundle\Entity\User1" algorithm="plaintext" />
  9. <encoder class="JMS\FooBundle\Entity\User2" algorithm="sha1" encode-as-base64="false" iterations="5" />
  10. <encoder class="JMS\FooBundle\Entity\User3" algorithm="md5" />
  11. <encoder class="JMS\FooBundle\Entity\User4" id="security.encoder.foo" />
  12. <encoder class="JMS\FooBundle\Entity\User5" algorithm="pbkdf2" hash-algorithm="sha1" encode-as-base64="false" iterations="5" key-length="30" />
  13. <encoder class="JMS\FooBundle\Entity\User6" algorithm="bcrypt" cost="15" />
  14. <provider name="default">
  15. <memory>
  16. <user name="foo" password="foo" roles="ROLE_USER" />
  17. </memory>
  18. </provider>
  19. <provider name="digest">
  20. <memory>
  21. <user name="foo" password="foo" roles="ROLE_USER, ROLE_ADMIN" />
  22. </memory>
  23. </provider>
  24. <provider name="basic">
  25. <memory>
  26. <user name="foo" password="0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33" roles="ROLE_SUPER_ADMIN" />
  27. <user name="bar" password="0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33" roles="ROLE_USER, ROLE_ADMIN" />
  28. </memory>
  29. </provider>
  30. <provider name="service" id="user.manager" />
  31. <provider name="chain">
  32. <chain providers="service, basic" />
  33. </provider>
  34. <firewall name="simple" pattern="/login" security="false" />
  35. <firewall name="secure" stateless="true">
  36. <http-basic />
  37. <http-digest secret="TheSecret" />
  38. <form-login />
  39. <anonymous />
  40. <switch-user />
  41. <x509 />
  42. <remote-user />
  43. <user-checker />
  44. <logout />
  45. <remember-me secret="TheSecret"/>
  46. </firewall>
  47. <firewall name="host" pattern="/test" host="foo\.example\.org" methods="GET,POST">
  48. <anonymous />
  49. <http-basic />
  50. </firewall>
  51. <firewall name="with_user_checker">
  52. <anonymous />
  53. <http-basic />
  54. <user-checker>app.user_checker</user-checker>
  55. </firewall>
  56. <firewall name="simple_auth" provider="default">
  57. <anonymous />
  58. <simple-form authenticator="simple_authenticator" />
  59. </firewall>
  60. <role id="ROLE_ADMIN">ROLE_USER</role>
  61. <role id="ROLE_SUPER_ADMIN">ROLE_USER,ROLE_ADMIN,ROLE_ALLOWED_TO_SWITCH</role>
  62. <role id="ROLE_REMOTE">ROLE_USER,ROLE_ADMIN</role>
  63. <rule path="/blog/524" role="ROLE_USER" requires-channel="https" methods="get,POST" />
  64. <rule role='IS_AUTHENTICATED_ANONYMOUSLY' path="/blog/.*" />
  65. <rule role='IS_AUTHENTICATED_ANONYMOUSLY' allow-if="token.getUsername() matches '/^admin/'" path="/blog/524" />
  66. </config>
  67. </srv:container>