Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[PasswordHasher] Update example of usageCustomPasswordHasher#21181

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
andreybolonin wants to merge2 commits intosymfony:7.3
base:7.3
Choose a base branch
Loading
fromandreybolonin:patch-6
Open
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletionssecurity/passwords.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -626,7 +626,7 @@ you must register a service for it in order to use it as a named hasher:
security:
# ...
password_hashers:
app_hasher:
App\Entity\User:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

We'd need to also update the XML and PHP examples.

And, at the end of this section we have this, that should also be updated:

This creates a hasher namedapp_hasher from a service [...]

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

fixed

id: 'App\Security\Hasher\MyCustomPasswordHasher'

.. code-block:: xml
Expand All@@ -644,7 +644,7 @@ you must register a service for it in order to use it as a named hasher:

<config>
<!-- ... -->
<security:password_hasher class="app_hasher"
<security:password_hasher class="App\Entity\User"
id="App\Security\Hasher\MyCustomPasswordHasher"/>
</config>
</srv:container>
Expand All@@ -657,12 +657,12 @@ you must register a service for it in order to use it as a named hasher:

return static function (SecurityConfig $security): void {
// ...
$security->passwordHasher('app_hasher')
$security->passwordHasher('App\Entity\User')
->id(MyCustomPasswordHasher::class)
;
};

This creates a hasher named ``app_hasher`` from a service with the ID
This creates a hasher named ``App\Entity\User`` from a service with the ID
``App\Security\Hasher\MyCustomPasswordHasher``.

Hashing a Stand-Alone String
Expand DownExpand Up@@ -842,7 +842,7 @@ Now, define a password hasher using the ``id`` setting:
security:
# ...
password_hashers:
app_hasher:
App\Entity\User:
# the service ID of your custom hasher (the FQCN using the default services.yaml)
id: 'App\Security\Hasher\MyCustomPasswordHasher'

Expand All@@ -862,7 +862,7 @@ Now, define a password hasher using the ``id`` setting:
<config>
<!-- ... -->
<!-- id: the service ID of your custom hasher (the FQCN using the default services.yaml) -->
<security:password_hasher class="app_hasher"
<security:password_hasher class="App\Entity\User"
id="App\Security\Hasher\CustomVerySecureHasher"/>
</config>
</srv:container>
Expand All@@ -875,7 +875,7 @@ Now, define a password hasher using the ``id`` setting:

return static function (SecurityConfig $security): void {
// ...
$security->passwordHasher('app_hasher')
$security->passwordHasher('App\Entity\User')
// the service ID of your custom hasher (the FQCN using the default services.yaml)
->id(CustomVerySecureHasher::class)
;
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp