ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
linkback.php
Go to the documentation of this file.
1<?php
2
7// For backwards compatability look for AuthState first
8if (array_key_exists('AuthState', $_REQUEST) && !empty($_REQUEST['AuthState'])) {
10} elseif (array_key_exists('state', $_REQUEST) && !empty($_REQUEST['state'])) {
12} else {
13 throw new SimpleSAML_Error_BadRequest('Missing state parameter on facebook linkback endpoint.');
14}
15
16// Find authentication source
19}
21
23if ($source === NULL) {
24 throw new SimpleSAML_Error_BadRequest('Could not find authentication source with id ' . var_export($sourceId, TRUE));
25}
26
27try {
28 if (isset($_REQUEST['error_reason']) && $_REQUEST['error_reason'] == 'user_denied') {
30 }
31
32 $source->finalStep($state);
33} catch (SimpleSAML_Error_Exception $e) {
35} catch (Exception $e) {
36 SimpleSAML_Auth_State::throwException($state, new SimpleSAML_Error_AuthSource($sourceId, 'Error on facebook linkback endpoint.', $e));
37}
38
if(!array_key_exists(sspmod_authfacebook_Auth_Source_Facebook::AUTHID, $state)) $sourceId
Definition: linkback.php:20
$source
Definition: linkback.php:22
if(!array_key_exists('stateid', $_REQUEST)) $state
Handle linkback() response from LinkedIn.
Definition: linkback.php:10
An exception for terminatinating execution or to throw for unit testing.
static getById($authId, $type=null)
Retrieve authentication source.
Definition: Source.php:324
static completeAuth(&$state)
Complete authentication.
Definition: Source.php:135
static throwException($state, SimpleSAML_Error_Exception $exception)
Throw exception to the state exception handler.
Definition: State.php:343
static loadState($id, $stage, $allowMissing=false)
Retrieve saved state.
Definition: State.php:259
const AUTHID
The key of the AuthId field in the state.
Definition: Facebook.php:21
const STAGE_INIT
The string used to identify our states.
Definition: Facebook.php:15