Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d430972

Browse filesBrowse files
Valantis Koutsoumposjaviereguiluz
Valantis Koutsoumpos
authored andcommitted
Added documentation about authentication for multiple firewalls under the same firewall context
1 parent 6b0549a commit d430972
Copy full SHA for d430972

File tree

1 file changed

+19
-0
lines changed
Filter options

1 file changed

+19
-0
lines changed

‎testing/http_authentication.rst

Copy file name to clipboardExpand all lines: testing/http_authentication.rst
+19Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,3 +124,22 @@ needs::
124124
$this->client->getCookieJar()->set($cookie);
125125
}
126126
}
127+
128+
If your setup contains multiple firewalls sharing the same firewall context, you need to generate the
129+
*authentication token* by using one of the firewall names as provider key and set the security session
130+
using the firewall context name::
131+
132+
private function logIn()
133+
{
134+
$session = $this->client->getContainer()->get('session');
135+
136+
$firewallName = 'secure_area';
137+
$firewallContext = 'firewall_context';
138+
139+
$token = new UsernamePasswordToken('admin', null, $firewallName, array('ROLE_ADMIN'));
140+
$session->set('_security_'.$firewallContext, serialize($token));
141+
$session->save();
142+
143+
$cookie = new Cookie($session->getName(), $session->getId());
144+
$this->client->getCookieJar()->set($cookie);
145+
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.