4
4
Using pre Authenticated Security Firewalls
5
5
==========================================
6
6
7
- A lot of authentication modules are already provided by some webservers ,
7
+ A lot of authentication modules are already provided by some web servers ,
8
8
including Apache. These modules generally set some environment variables
9
- that can be used to determine which user is accessing your application. Out of the
9
+ that can be used to determine which user is accessing your application. Out of the
10
10
box, Symfony supports most authentication mechanisms.
11
11
These requests are called *pre authenticated * requests because the user is already
12
12
authenticated when reaching your application.
13
13
14
- .. note ::
15
-
16
- An authentication provider will only inform the user provider of the username
17
- that made the request. You will need to either use an available
18
- :class: `Symfony\\ Component\\ Security\\ Core\\ User\\ UserProviderInterface `
19
- or implement your own:
20
-
21
- * :doc: `/cookbook/security/entity_provider `
22
- * :doc: `/cookbook/security/custom_provider `
23
-
24
14
X.509 Client Certificate Authentication
25
15
---------------------------------------
26
16
@@ -44,12 +34,17 @@ Enable the x509 authentication for a particular firewall in the security configu
44
34
45
35
.. code-block :: xml
46
36
37
+ <?xml version =" 1.0" ?>
47
38
<!-- app/config/security.xml -->
48
- <config >
49
- <firewall name =" secured_area" pattern =" ^/" >
50
- <x509 provider =" your_user_provider" />
51
- </firewall >
52
- </config >
39
+ <srv : container xmlns =" http://symfony.com/schema/dic/security"
40
+ xmlns : srv =" http://symfony.com/schema/dic/services" >
41
+
42
+ <config >
43
+ <firewall name =" secured_area" pattern =" ^/" >
44
+ <x509 provider =" your_user_provider" />
45
+ </firewall >
46
+ </config >
47
+ </srv : container >
53
48
54
49
.. code-block :: php
55
50
@@ -66,7 +61,16 @@ Enable the x509 authentication for a particular firewall in the security configu
66
61
));
67
62
68
63
By default, the firewall provides the ``SSL_CLIENT_S_DN_Email `` variable to
69
- the user provider, and sets the ``SSL_CLIENT_S_DN `` as credentials in the
64
+ the user provider, and sets the ``SSL_CLIENT_S_DN `` as credentials in the
70
65
:class: `Symfony\\ Component\\ Security\\ Core\\ Authentication\\ Token\\ PreAuthenticatedToken `.
71
66
You can override these by setting the ``user `` and the ``credentials `` keys
72
67
in the x509 firewall configuration respectively.
68
+
69
+ .. note ::
70
+
71
+ An authentication provider will only inform the user provider of the username
72
+ that made the request. You will need to create (or use) a "user provider" that
73
+ turns that username into a User object of your choice:
74
+
75
+ * :doc: `/cookbook/security/custom_provider `
76
+ * :doc: `/cookbook/security/entity_provider `
0 commit comments