3require_once(dirname(dirname(dirname(dirname(dirname(__FILE__))))) . 
'/oauth/libextinc/OAuth.php');
 
   34                assert(
'is_array($info)');
 
   35                assert(
'is_array($config)');
 
   40                if (!array_key_exists(
'key', 
$config))
 
   41                        throw new Exception(
'MySpace authentication source is not properly configured: missing [key]');
 
   45                if (!array_key_exists(
'secret', 
$config))
 
   46                        throw new Exception(
'MySpace authentication source is not properly configured: missing [secret]');
 
   48                $this->secret = 
$config[
'secret'];
 
   58                assert(
'is_array($state)');
 
   76                $consumer->getAuthorizeRequest(
'http://api.myspace.com/authorize', 
$requestToken, TRUE, 
SimpleSAML\Module::getModuleUrl(
'authmyspace') . 
'/linkback.php?stateid=' . $stateID);
 
  103                                if (is_string($value) || is_int($value))
 
  106                                if (is_array($value)) {
 
  107                                        foreach($value AS $key2 => $value2) {
 
  108                                                if (is_string($value2) || is_int($value2))
 
  114                        if (array_key_exists(
'id', 
$userdata[
'person']) ) {
 
  117                                if (preg_match(
'/(\d+)$/',
$userdata[
'person'][
'id'],$matches)) {
 
  118                                        $attributes[
'myspace_targetedID'] = array(
'http://myspace.com!' . $matches[1]);
 
  120                                        $attributes[
'myspace_user'] = array($matches[1] . 
'@myspace.com');
 
  125                        if (array_key_exists(
'profileUrl', 
$userdata[
'person']) ) {
 
  126                                if (preg_match(
'@/([^/]+)$@',
$userdata[
'person'][
'profileUrl'],$matches)) {
 
  127                                        $attributes[
'myspace_username'] = array($matches[1]);
 
  128                                        $attributes[
'myspace_user'] = array($matches[1] . 
'@myspace.com');
 
if(!array_key_exists('stateid', $_REQUEST)) $state
Handle linkback() response from LinkedIn.
An exception for terminatinating execution or to throw for unit testing.
static saveState(&$state, $stage, $rawId=false)
Save the state.
__construct($info, $config)
Constructor for this authentication source.
authenticate(&$state)
Log-in using MySpace platform.
const STAGE_INIT
The string used to identify our states.
const AUTHID
The key of the AuthId field in the state.
Attribute-related utility methods.