@@ 190-214 (lines=25) @@ | ||
187 | return $this->renderSamlResponse('consumeAssertion', $response); |
|
188 | } |
|
189 | ||
190 | public function sendLoaCannotBeGivenAction() |
|
191 | { |
|
192 | $responseContext = $this->getResponseContext(); |
|
193 | $originalRequestId = $responseContext->getInResponseTo(); |
|
194 | ||
195 | /** @var \Surfnet\SamlBundle\Monolog\SamlAuthenticationLogger $logger */ |
|
196 | $logger = $this->get('surfnet_saml.logger')->forAuthentication($originalRequestId); |
|
197 | $logger->notice('Loa cannot be given, creating Response with NoAuthnContext status'); |
|
198 | ||
199 | /** @var \Surfnet\StepupGateway\GatewayBundle\Saml\ResponseBuilder $responseBuilder */ |
|
200 | $responseBuilder = $this->get('gateway.proxy.response_builder'); |
|
201 | ||
202 | $response = $responseBuilder |
|
203 | ->createNewResponse($responseContext) |
|
204 | ->setResponseStatus(Constants::STATUS_RESPONDER, Constants::STATUS_NO_AUTHN_CONTEXT) |
|
205 | ->get(); |
|
206 | ||
207 | $logger->notice(sprintf( |
|
208 | 'Responding to request "%s" with response based on response from the remote IdP with response "%s"', |
|
209 | $responseContext->getInResponseTo(), |
|
210 | $response->getId() |
|
211 | )); |
|
212 | ||
213 | return $this->renderSamlResponse('consumeAssertion', $response); |
|
214 | } |
|
215 | ||
216 | public function sendAuthenticationCancelledByUserAction() |
|
217 | { |
|
@@ 216-244 (lines=29) @@ | ||
213 | return $this->renderSamlResponse('consumeAssertion', $response); |
|
214 | } |
|
215 | ||
216 | public function sendAuthenticationCancelledByUserAction() |
|
217 | { |
|
218 | $responseContext = $this->getResponseContext(); |
|
219 | $originalRequestId = $responseContext->getInResponseTo(); |
|
220 | ||
221 | /** @var \Surfnet\SamlBundle\Monolog\SamlAuthenticationLogger $logger */ |
|
222 | $logger = $this->get('surfnet_saml.logger')->forAuthentication($originalRequestId); |
|
223 | $logger->notice('Authentication was cancelled by the user, creating Response with AuthnFailed status'); |
|
224 | ||
225 | /** @var \Surfnet\StepupGateway\GatewayBundle\Saml\ResponseBuilder $responseBuilder */ |
|
226 | $responseBuilder = $this->get('gateway.proxy.response_builder'); |
|
227 | ||
228 | $response = $responseBuilder |
|
229 | ->createNewResponse($responseContext) |
|
230 | ->setResponseStatus( |
|
231 | Constants::STATUS_RESPONDER, |
|
232 | Constants::STATUS_AUTHN_FAILED, |
|
233 | 'Authentication cancelled by user' |
|
234 | ) |
|
235 | ->get(); |
|
236 | ||
237 | $logger->notice(sprintf( |
|
238 | 'Responding to request "%s" with response based on response from the remote IdP with response "%s"', |
|
239 | $responseContext->getInResponseTo(), |
|
240 | $response->getId() |
|
241 | )); |
|
242 | ||
243 | return $this->renderSamlResponse('consumeAssertion', $response); |
|
244 | } |
|
245 | ||
246 | /** |
|
247 | * @param string $view |