ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
discoresp.php
Go to the documentation of this file.
1<?php
2
7if (!array_key_exists('AuthID', $_REQUEST)) {
8 throw new SimpleSAML_Error_BadRequest('Missing AuthID to discovery service response handler');
9}
10
11if (!array_key_exists('idpentityid', $_REQUEST)) {
12 throw new SimpleSAML_Error_BadRequest('Missing idpentityid to discovery service response handler');
13}
14$state = SimpleSAML_Auth_State::loadState($_REQUEST['AuthID'], 'saml:sp:sso');
15
16// Find authentication source
17assert('array_key_exists("saml:sp:AuthId", $state)');
18$sourceId = $state['saml:sp:AuthId'];
19
21if ($source === NULL) {
22 throw new Exception('Could not find authentication source with id ' . $sourceId);
23}
24if (!($source instanceof sspmod_saml_Auth_Source_SP)) {
25 throw new SimpleSAML_Error_Exception('Source type changed?');
26}
27
28$source->startSSO($_REQUEST['idpentityid'], $state);
An exception for terminatinating execution or to throw for unit testing.
static getById($authId, $type=null)
Retrieve authentication source.
Definition: Source.php:324
static loadState($id, $stage, $allowMissing=false)
Retrieve saved state.
Definition: State.php:259
$source
Definition: discoresp.php:20
$sourceId
Definition: discoresp.php:18
if(!array_key_exists( 'AuthID', $_REQUEST)) if(!array_key_exists('idpentityid', $_REQUEST)) $state
Handler for response from IdP discovery service.
Definition: discoresp.php:14