Skip to content

Commit 8ddb26b

Browse files
xabbuhweaverryan
authored andcommitted
clarify the authenticator type
1 parent 1bd187f commit 8ddb26b

File tree

3 files changed

+24
-13
lines changed

3 files changed

+24
-13
lines changed

cookbook/map.rst.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
* :doc:`/cookbook/security/form_login`
136136
* :doc:`/cookbook/security/securing_services`
137137
* :doc:`/cookbook/security/custom_provider`
138-
* :doc:`/cookbook/security/custom_authenticator`
138+
* :doc:`/cookbook/security/custom_password_authenticator`
139139
* :doc:`/cookbook/security/custom_authentication_provider`
140140
* :doc:`/cookbook/security/target_path`
141141

cookbook/security/custom_authenticator.rst renamed to cookbook/security/custom_password_authenticator.rst

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
.. index::
2-
single: Security; Custom Authenticator
2+
single: Security; Custom Password Authenticator
33

4-
How to create a Custom Authenticator
5-
====================================
4+
How to create a Custom Password Authenticator
5+
=============================================
66

77
Imagine you want to allow access to your website only between 2pm and 4pm (for
88
the UTC timezone). Before Symfony 2.4, you had to create a custom token, factory,
99
listener and provider.
1010

11-
The Authenticator
12-
-----------------
11+
The Password Authenticator
12+
--------------------------
13+
14+
.. versionadded:: 2.4
15+
The ``SimpleFormAuthenticatorInterface`` interface was added in Symfony 2.4.
1316

1417
But now, thanks to new simplified authentication customization options in
1518
Symfony 2.4, you don't need to create a whole bunch of new classes, but use the
@@ -84,9 +87,6 @@ interface instead::
8487
}
8588
}
8689

87-
.. versionadded:: 2.4
88-
The ``SimpleFormAuthenticatorInterface`` interface was added in Symfony 2.4.
89-
9090
How it Works
9191
------------
9292

@@ -121,6 +121,8 @@ Now, configure your ``TimeAuthenticator`` as a service:
121121
122122
# app/config/config.yml
123123
services:
124+
# ...
125+
124126
time_authenticator:
125127
class: Acme\HelloBundle\Security\TimeAuthenticator
126128
arguments: [@security.encoder_factory]
@@ -134,9 +136,12 @@ Now, configure your ``TimeAuthenticator`` as a service:
134136
xsi:schemaLocation="http://symfony.com/schema/dic/services
135137
http://symfony.com/schema/dic/services/services-1.0.xsd">
136138
<services>
139+
<!-- ... -->
140+
137141
<service id="time_authenticator"
138-
class="Acme\HelloBundle\Security\TimeAuthenticator">
139-
<argument type="service" id="security.encoder_factory"/>
142+
class="Acme\HelloBundle\Security\TimeAuthenticator"
143+
>
144+
<argument type="service" id="security.encoder_factory" />
140145
</service>
141146
</services>
142147
</container>
@@ -185,19 +190,25 @@ like this:
185190
xsi:schemaLocation="http://symfony.com/schema/dic/services
186191
http://symfony.com/schema/dic/services/services-1.0.xsd">
187192
<config>
193+
<!-- ... -->
194+
188195
<firewall name="secured_area"
189196
pattern="^/admin"
190197
provider="authenticator">
191198
<simple-form authenticator="time_authenticator"
192199
check-path="login_check"
193-
login-path="login" />
200+
login-path="login"
201+
/>
194202
</firewall>
195203
</config>
196204
</srv:container>
197205
198206
.. code-block:: php
199207
200208
// app/config/security.php
209+
210+
// ..
211+
201212
$container->loadFromExtension('security', array(
202213
'firewalls' => array(
203214
'secured_area' => array(

cookbook/security/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ Security
1313
form_login
1414
securing_services
1515
custom_provider
16-
custom_authenticator
16+
custom_password_authenticator
1717
custom_authentication_provider
1818
target_path

0 commit comments

Comments
 (0)