Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
minor symfony#9733 Documentation about authentication for multiple fi…
…rewalls 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 symfony#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
  • Loading branch information
javiereguiluz committed May 24, 2018
2 parents 6b0549a + eae4a3c commit 9772551
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions testing/http_authentication.rst
Expand Up @@ -113,10 +113,12 @@ needs::
{
$session = $this->client->getContainer()->get('session');

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

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

Expand Down

0 comments on commit 9772551

Please sign in to comment.