Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
Silex
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
common
Silex
Commits
496aa805
Commit
496aa805
authored
Jun 17, 2012
by
Fabien Potencier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed documentation (closes #375)
parent
315c9626
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
doc/providers/security.rst
doc/providers/security.rst
+11
-3
No files found.
doc/providers/security.rst
View file @
496aa805
...
...
@@ -127,14 +127,22 @@ Each user is defined with the following information:
The default configuration of the extension enforces encoded passwords. To
generate a valid encoded password from a raw password, use the
``security.encoder`` service::
``security.encoder
_factory
`` service::
// find the encoded password for foo
$password = $app['security.encoder']->encodePassword('foo', null);
// find the encoder for the User class (which is the default)
$encoder = $app['security.encoder_factory']->getEncoder('Symfony\Component\Security\Core\User\User');
// compute the encoded password for foo
$password = $encoder->encodePassword('foo', null);
The second argument is the salt to be used for the user (defaults to
``null``).
You can also get the encoder directly by its name. By default, use the
``security.encoder.digest`` service::
$password = $app['security.encoder.digest']->encodePassword('foo', null);
When the user is authenticated, the user stored in the token is an instance of
`User
<http://api.symfony.com/master/Symfony/Component/Security/Core/User/User.html>`_
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment