1 | <?php |
||
53 | class SamlProxyController extends Controller |
||
54 | { |
||
55 | /** |
||
56 | * Proxy a GSSP authentication request to the remote GSSP SSO endpoint. |
||
57 | * |
||
58 | * The user is about to be sent to the remote GSSP application for |
||
59 | * registration. Verification is not initiated with a SAML AUthnRequest, |
||
60 | * see sendSecondFactorVerificationAuthnRequestAction(). |
||
61 | * |
||
62 | * The service provider in this context is SelfService (when registering |
||
63 | * a token) or RA (when vetting a token). |
||
64 | * |
||
65 | * @param string $provider |
||
66 | * @param Request $httpRequest |
||
67 | * @return \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response |
||
68 | */ |
||
69 | public function singleSignOnAction($provider, Request $httpRequest) |
||
88 | |||
89 | /** |
||
90 | * Start a GSSP single sign-on. |
||
91 | * |
||
92 | * The user has selected a second factor token and the token happens to be |
||
93 | * a GSSP token. The SecondFactorController therefor did an internal |
||
94 | * redirect (see SecondFactorController::verifyGssfAction) to this method. |
||
95 | * |
||
96 | * In this method, an authn request is created. This authn request is sent |
||
97 | * directly to the remote GSSP SSO URL, and the response is handled in |
||
98 | * consumeAssertionAction(). |
||
99 | * |
||
100 | * @param $provider |
||
101 | * @param $subjectNameId |
||
102 | * @return \Symfony\Component\HttpFoundation\RedirectResponse |
||
103 | */ |
||
104 | public function sendSecondFactorVerificationAuthnRequestAction($provider, $subjectNameId) |
||
117 | |||
118 | /** |
||
119 | * Process an assertion received from the remote GSSP application. |
||
120 | * |
||
121 | * The GSSP application sent an assertion back to the gateway. When |
||
122 | * successful, the user is sent back to: |
||
123 | * |
||
124 | * 1. in case of registration: back to the originating SP (SelfService or RA) |
||
125 | * 2. in case of verification: internal redirect to SecondFactorController |
||
126 | * |
||
127 | * @param string $provider |
||
128 | * @param Request $httpRequest |
||
129 | * @return \Symfony\Component\HttpFoundation\Response |
||
130 | * @throws Exception |
||
131 | */ |
||
132 | public function consumeAssertionAction($provider, Request $httpRequest) |
||
165 | |||
166 | /** |
||
167 | * @param string $provider |
||
168 | * @return XMLResponse |
||
169 | */ |
||
170 | public function metadataAction($provider) |
||
179 | |||
180 | /** |
||
181 | * @param string $provider |
||
182 | * @return \Surfnet\StepupGateway\SamlStepupProviderBundle\Provider\Provider |
||
183 | */ |
||
184 | private function getProvider($provider) |
||
197 | |||
198 | /** |
||
199 | * @param StateHandler $stateHandler |
||
200 | * @return string |
||
201 | */ |
||
202 | private function getDestination(StateHandler $stateHandler) |
||
221 | |||
222 | /** |
||
223 | * @param string $view |
||
224 | * @param StateHandler $stateHandler |
||
225 | * @param SAMLResponse $response |
||
226 | * @return Response |
||
227 | */ |
||
228 | public function renderSamlResponse($view, StateHandler $stateHandler, SAMLResponse $response) |
||
247 | |||
248 | /** |
||
249 | * @param SAMLResponse $response |
||
250 | * @return string |
||
251 | */ |
||
252 | private function getResponseAsXML(SAMLResponse $response) |
||
256 | |||
257 | /** |
||
258 | * Response that indicates that an error occurred in the responder (the gateway). Used to indicate that we could |
||
259 | * not process the response we received from the upstream GSSP |
||
260 | * |
||
261 | * @param Provider $provider |
||
262 | * @param string $destination |
||
263 | * @return SAMLResponse |
||
264 | */ |
||
265 | private function createResponseFailureResponse(Provider $provider, $destination) |
||
272 | |||
273 | /** |
||
274 | * Response that indicates that the authentication could not be performed correctly. In this context it means |
||
275 | * that the upstream GSSP did not responsd with the same NameID as we request to authenticate in the AuthnRequest |
||
276 | * |
||
277 | * @param Provider $provider |
||
278 | * @param string $destination |
||
279 | * @return SAMLResponse |
||
280 | */ |
||
281 | private function createAuthnFailedResponse(Provider $provider, $destination) |
||
291 | |||
292 | /** |
||
293 | * Creates a standard response with default status Code (success) |
||
294 | * |
||
295 | * @param Provider $provider |
||
296 | * @param string $destination |
||
297 | * @return SAMLResponse |
||
298 | */ |
||
299 | private function createResponse(Provider $provider, $destination) |
||
309 | |||
310 | /** |
||
311 | * @param string $serviceProvider |
||
312 | * @return \Surfnet\StepupGateway\GatewayBundle\Entity\ServiceProvider |
||
313 | */ |
||
314 | private function getServiceProvider($serviceProvider) |
||
322 | |||
323 | /** |
||
324 | * @return LoginService |
||
325 | */ |
||
326 | private function getGsspLoginService() |
||
330 | |||
331 | /** |
||
332 | * @return SecondFactorVerificationService |
||
333 | */ |
||
334 | private function getGsspSecondFactorVerificationService() |
||
338 | |||
339 | /** |
||
340 | * @return ConsumeAssertionService |
||
341 | */ |
||
342 | private function getGsspConsumeAssertionService() |
||
346 | |||
347 | /** |
||
348 | * @param Provider $provider |
||
349 | * @return ProxyResponseFactory |
||
350 | */ |
||
351 | private function getProxyResponseFactory(Provider $provider) |
||
355 | } |
||
356 |
This check looks for a call to a parent method whose name is different than the method from which it is called.
Consider the following code:
The
getFirstName()
method in theSon
calls the wrong method in the parent class.