ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
linkback.php
Go to the documentation of this file.
1<?php
2
7if (!array_key_exists('stateid', $_REQUEST)) {
8 throw new Exception('State Lost - not returned by MySpace Auth');
9}
11
12if (array_key_exists('oauth_problem', $_REQUEST)) {
13 // oauth_problem of 'user_refused' means user chose not to login with MySpace
14 if (strcmp($_REQUEST['oauth_problem'],'user_refused') == 0) {
17 }
18
19 // Error
20 $e = new SimpleSAML_Error_Error('Authentication failed: ' . $_REQUEST['oauth_problem']);
22}
23
24if (array_key_exists('oauth_verifier', $_REQUEST)) {
25 $state['authmyspace:oauth_verifier'] = $_REQUEST['oauth_verifier'];
26} else {
27 throw new Exception('OAuth verifier not returned.');;
28}
29
30// Find authentication source
31assert('array_key_exists(sspmod_authmyspace_Auth_Source_MySpace::AUTHID, $state)');
33
35if ($source === NULL) {
36 throw new Exception('Could not find authentication source with id ' . $sourceId);
37}
38
39$source->finalStep($state);
40
42
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 STAGE_INIT
The string used to identify our states.
Definition: MySpace.php:16
const AUTHID
The key of the AuthId field in the state.
Definition: MySpace.php:21