Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.3k
[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
base:7.3
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -626,7 +626,7 @@ you must register a service for it in order to use it as a named hasher: | ||
| security: | ||
| # ... | ||
| password_hashers: | ||
| App\Entity\User: | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe 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:
ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. fixed | ||
| id: 'App\Security\Hasher\MyCustomPasswordHasher' | ||
| .. code-block:: xml | ||
| @@ -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\Entity\User" | ||
| id="App\Security\Hasher\MyCustomPasswordHasher"/> | ||
| </config> | ||
| </srv:container> | ||
| @@ -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\Entity\User') | ||
| ->id(MyCustomPasswordHasher::class) | ||
| ; | ||
| }; | ||
| This creates a hasher named ``App\Entity\User`` from a service with the ID | ||
| ``App\Security\Hasher\MyCustomPasswordHasher``. | ||
| Hashing a Stand-Alone String | ||
| @@ -842,7 +842,7 @@ Now, define a password hasher using the ``id`` setting: | ||
| security: | ||
| # ... | ||
| password_hashers: | ||
| App\Entity\User: | ||
| # the service ID of your custom hasher (the FQCN using the default services.yaml) | ||
| id: 'App\Security\Hasher\MyCustomPasswordHasher' | ||
| @@ -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\Entity\User" | ||
| id="App\Security\Hasher\CustomVerySecureHasher"/> | ||
| </config> | ||
| </srv:container> | ||
| @@ -875,7 +875,7 @@ Now, define a password hasher using the ``id`` setting: | ||
| return static function (SecurityConfig $security): void { | ||
| // ... | ||
| $security->passwordHasher('App\Entity\User') | ||
| // the service ID of your custom hasher (the FQCN using the default services.yaml) | ||
| ->id(CustomVerySecureHasher::class) | ||
| ; | ||
Uh oh!
There was an error while loading.Please reload this page.