Skip to content

Commit de932b0

Browse files
committed
minor #9038 doc(testing/http_authentication.rst) (Sydney-o9, javiereguiluz)
This PR was submitted for the master branch but it was merged into the 2.8 branch instead (closes #9038). Discussion ---------- doc(testing/http_authentication.rst) - [x] Added notes for people using Guard with the `PostAuthenticationGuardToken` Commits ------- 1089de8 Simplify a946faa doc(testing/http_authentication.rst);
2 parents 922577a + 1089de8 commit de932b0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

testing/http_authentication.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ needs::
118118
// See https://symfony.com/doc/current/reference/configuration/security.html#firewall-context
119119
$firewallContext = 'secured_area';
120120

121+
// you may need to use a different token class depending on your application.
122+
// for example, when using Guard authentication you must instantiate PostAuthenticationGuardToken
121123
$token = new UsernamePasswordToken('admin', null, $firewallName, array('ROLE_ADMIN'));
122124
$session->set('_security_'.$firewallContext, serialize($token));
123125
$session->save();

0 commit comments

Comments
 (0)