Skip to content

Commit a57a342

Browse files
committed
minor symfony#44413 [Security] Document deprecations in PreAuthenticatedToken (gjuric)
This PR was merged into the 5.4 branch. Discussion ---------- [Security] Document deprecations in PreAuthenticatedToken | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | Fix symfony#44396 | License | MIT Document deprecations in PreAuthenticatedToken Commits ------- 058720f Document deprecations in Security Tokens
2 parents e9fca97 + 058720f commit a57a342

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

UPGRADE-5.4.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,3 +170,19 @@ Security
170170
* Deprecate passing the strategy as string to `AccessDecisionManager`,
171171
pass an instance of `AccessDecisionStrategyInterface` instead
172172
* Flag `AccessDecisionManager` as `@final`
173+
* Deprecate passing `$credentials` to `PreAuthenticatedToken`,
174+
`SwitchUserToken` and `UsernamePasswordToken`:
175+
176+
Before:
177+
```php
178+
$token = new UsernamePasswordToken($user, $credentials, $firewallName, $roles);
179+
$token = new PreAuthenticatedToken($user, $credentials, $firewallName, $roles);
180+
$token = new SwitchUserToken($user, $credentials, $firewallName, $roles, $originalToken);
181+
```
182+
183+
After:
184+
```php
185+
$token = new UsernamePasswordToken($user, $firewallName, $roles);
186+
$token = new PreAuthenticatedToken($user, $firewallName, $roles);
187+
$token = new SwitchUserToken($user, $firewallName, $roles, $originalToken);
188+
```

UPGRADE-6.0.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,22 @@ Security
408408
```
409409
* `AccessDecisionManager` does not accept strings as strategy anymore,
410410
pass an instance of `AccessDecisionStrategyInterface` instead
411+
* Removed the `$credentials` argument of `PreAuthenticatedToken`,
412+
`SwitchUserToken` and `UsernamePasswordToken`:
413+
414+
Before:
415+
```php
416+
$token = new UsernamePasswordToken($user, $credentials, $firewallName, $roles);
417+
$token = new PreAuthenticatedToken($user, $credentials, $firewallName, $roles);
418+
$token = new SwitchUserToken($user, $credentials, $firewallName, $roles, $originalToken);
419+
```
420+
421+
After:
422+
```php
423+
$token = new UsernamePasswordToken($user, $firewallName, $roles);
424+
$token = new PreAuthenticatedToken($user, $firewallName, $roles);
425+
$token = new SwitchUserToken($user, $firewallName, $roles, $originalToken);
426+
```
411427

412428
SecurityBundle
413429
--------------

0 commit comments

Comments
 (0)