File tree 1 file changed +19
-0
lines changed
Filter options
1 file changed +19
-0
lines changed
Original file line number Diff line number Diff line change @@ -124,3 +124,22 @@ needs::
124
124
$this->client->getCookieJar()->set($cookie);
125
125
}
126
126
}
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
+ }
You can’t perform that action at this time.
0 commit comments