8000 minor #9733 Documentation about authentication for multiple firewalls… · symfony/symfony-docs@9772551 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9772551

Browse files
committed
minor #9733 Documentation about authentication for multiple firewalls under same context (Valantis Koutsoumpos, javiereguiluz)
This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #9733). Discussion ---------- Documentation about authentication for multiple firewalls under same context Added documentation about authentication for multiple firewalls under the same firewall context <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/roadmap for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `master` for features of unreleased versions). --> Commits ------- eae4a3c Reword d430972 Added documentation about authentication for multiple firewalls under the same firewall context
2 parents 6b0549a + eae4a3c commit 9772551

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

testing/http_authentication.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,12 @@ needs::
113113
{
114114
$session = $this->client->getContainer()->get('session');
115115

116-
// the firewall context defaults to the firewall name
116+
$firewallName = 'secure_area';
117+
// if you don't define multiple connected firewalls, the context defaults to the firewall name
118+
// See https://symfony.com/doc/current/reference/configuration/security.html#firewall-context
117119
$firewallContext = 'secured_area';
118120

119-
$token = new UsernamePasswordToken('admin', null, $firewallContext, array('ROLE_ADMIN'));
121+
$token = new UsernamePasswordToken('admin', null, $firewallName, array('ROLE_ADMIN'));
120122
$session->set('_security_'.$firewallContext, serialize($token));
121123
$session->save();
122124

0 commit comments

Comments
 (0)
0