1 | <?php |
||
20 | class AuthenticationDataCollector extends DataCollector implements DataCollectorInterface |
||
21 | { |
||
22 | /** |
||
23 | * @var ShibbolethServiceProvider |
||
24 | */ |
||
25 | protected $shibbolethServiceProvider; |
||
26 | |||
27 | /** |
||
28 | * @var FirewallHelper |
||
29 | */ |
||
30 | protected $firewallHelper; |
||
31 | |||
32 | /** |
||
33 | * @var null|TokenStorageInterface |
||
34 | */ |
||
35 | protected $tokenStorage; |
||
36 | |||
37 | /** |
||
38 | * @var KernelInterface |
||
39 | */ |
||
40 | protected $kernel; |
||
41 | |||
42 | /** |
||
43 | * @param ShibbolethServiceProvider $shibbolethServiceProvider |
||
44 | * @param FirewallHelper $firewallHelper |
||
45 | * @param TokenStorageInterface|null $tokenStorage |
||
46 | * @param KernelInterface $kernel |
||
47 | */ |
||
48 | public function __construct(ShibbolethServiceProvider $shibbolethServiceProvider, FirewallHelper $firewallHelper, KernelInterface $kernel, TokenStorageInterface $tokenStorage = null) |
||
56 | |||
57 | /** |
||
58 | * @return bool |
||
59 | */ |
||
60 | protected function isTokenStorageEnabled() |
||
64 | |||
65 | /** |
||
66 | * @return TokenInterface |
||
67 | */ |
||
68 | protected function findToken() |
||
75 | |||
76 | /** |
||
77 | * @return null|KuleuvenUserToken |
||
78 | */ |
||
79 | protected function findSourceToken() |
||
93 | |||
94 | /** |
||
95 | * @inheritdoc |
||
96 | */ |
||
97 | public function collect(Request $request, Response $response, \Exception $exception = null) |
||
149 | |||
150 | /** |
||
151 | * @return string |
||
152 | */ |
||
153 | public function getImage() |
||
157 | |||
158 | /** |
||
159 | * @return array |
||
160 | */ |
||
161 | public function getShibboleth() |
||
165 | |||
166 | /** |
||
167 | * Checks if security is enabled. |
||
168 | * |
||
169 | * @return bool true if security is enabled, false otherwise |
||
170 | */ |
||
171 | public function isEnabled() |
||
175 | |||
176 | /** |
||
177 | * Checks if the user is authenticated or not. |
||
178 | * |
||
179 | * @return bool true if the user is authenticated, false otherwise |
||
180 | */ |
||
181 | public function isAuthenticated() |
||
185 | |||
186 | /** |
||
187 | * Gets the user. |
||
188 | * |
||
189 | * @return string The user |
||
190 | */ |
||
191 | public function getUser() |
||
195 | |||
196 | /** |
||
197 | * Gets the display name. |
||
198 | * |
||
199 | * @return string The display name |
||
200 | */ |
||
201 | public function getDisplayName() |
||
205 | |||
206 | /** |
||
207 | * Gets the unscoped affiliation. |
||
208 | * |
||
209 | * @return string The unscoped affiliation |
||
210 | */ |
||
211 | public function getAffiliation() |
||
215 | |||
216 | /** |
||
217 | * Gets all the attributes. |
||
218 | * |
||
219 | * @return string The attributes |
||
220 | */ |
||
221 | public function getAttributes() |
||
225 | |||
226 | /** |
||
227 | * Get the class name of the security token. |
||
228 | * |
||
229 | * @return string The token |
||
230 | */ |
||
231 | public function getTokenClass() |
||
235 | |||
236 | /** |
||
237 | * Gets the source user. |
||
238 | * |
||
239 | * @return string The source user |
||
240 | */ |
||
241 | public function getImpersonatedUser() |
||
245 | |||
246 | /** |
||
247 | * Gets the display name. |
||
248 | * |
||
249 | * @return string The display name |
||
250 | */ |
||
251 | public function getImpersonatedDisplayName() |
||
255 | |||
256 | /** |
||
257 | * Gets the unscoped affiliation. |
||
258 | * |
||
259 | * @return string The unscoped affiliation |
||
260 | */ |
||
261 | public function getImpersonatedAffiliation() |
||
265 | |||
266 | /** |
||
267 | * Gets all the attributes. |
||
268 | * |
||
269 | * @return string The attributes |
||
270 | */ |
||
271 | public function getImpersonatedAttributes() |
||
275 | |||
276 | /** |
||
277 | * Get the class name of the source security token. |
||
278 | * |
||
279 | * @return string The source token |
||
280 | */ |
||
281 | public function getImpersonatedTokenClass() |
||
285 | |||
286 | /** |
||
287 | * @inheritdoc |
||
288 | */ |
||
289 | public function getName() |
||
293 | } |
||
294 |