initialize() public static method

Try to initialize Hybrid_Auth with given $config hash or file
public static initialize ( array $config ) : void
$config array Configuration array or path to a configratuion file
return void
Esempio n. 1
0
 public static function authInit()
 {
     $storage = new Hybrid_Storage();
     header('X-Hybridauth-Version: ' . $storage->config("version"));
     header('X-Hybridauth-Time: ' . time());
     header('X-Hybridauth-Init: ' . strlen(json_encode($storage->config("CONFIG"))));
     if (!WSL_Hybrid_Endpoint::$initDone) {
         WSL_Hybrid_Endpoint::$initDone = TRUE;
         // Check if Hybrid_Auth session already exist
         if (!$storage->config("CONFIG")) {
             WSL_Hybrid_Endpoint::dieError("406 Not Acceptable", "The session identifier is missing.<br />For more information refer to WSL <a href='http://miled.github.io/wordpress-social-login/troubleshooting.html' target='_blank'>Troubleshooting</a>. <img style='width: 35px; height: 35px; position: absolute; bottom: 20px; right: 20px;' src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAL4AAAC+CAYAAACLdLWdAAAAIHRFWHRTUFJEAGltYWdlLW5hMDIucHJ2LmRmdy5zcHJkLm5ldOQepWYAABYTSURBVHja7Z0J2E3VGse3eQqRIVMyRzLLEKXiFslUVKZKHkMylIiuSlIpSilDxA1pUCgZmoQSSgMlXHQzh8hYhmTd9d/f3t9d1j3f5+xz9jln7e/8f8/zPj2+ztlnn73fs/Za7/q/72tZhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQkKQTVoeaQWlFZZWU1ozaf+Q1lRaDefvBZ3XZeMlI0Eju7Ry0npKe0XacmlbpO2XdlqaSMdOOa/b7LwP7+8urbRzXEKMIZO0AtL6SftA2nZpZ8/j4JHYDuf490kr5HwuIXEnl7T+0pZJO+HFiTNlyiSyZ88ucubMKbJlyxbJj+BP53MH8ElA4kVFaf+SdjA956xUqZK47777xMSJE8WCBQvEd999J7Zt2yZOnDghdM6ePWv//ZdffrFft3DhQjFp0iTRt29fUb58+fP9C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ZbgbSN+ca209y1F66MacjI7depkFxhCSRM/mlPgiYK8WdSwbNGiRXoVl6EbR6JEGd4mEivQUBobXwes81QugxSib9++dnbU9OnT7SZgqJW/du1aOxECBhkBNs2weEbuKaJI3bt3F5dffrneTSOUoSjpcGdRTkhcwPz5HiulctshK34ForZbKVlBN1jceSUJBjvAHaRNlva1lUYqXYSGJ8sSKyUjqAGdnZgMQqKoofiQlSKGw+IYCdwbnREb+vC9Vkq1AeymbrNS9OJo/Dtb2jgrJVe4Ih2dZASyOE8H3bJYPvY+JYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIISTQ/BfJWilyNG3IOAAAAABJRU5ErkJggg==' />");
         }
         # Init Hybrid_Auth
         try {
             Hybrid_Auth::initialize($storage->config("CONFIG"));
         } catch (Exception $e) {
             WSL_Hybrid_Endpoint::dieError('500 Internal Server Error', 'An error occurred while attempting to initialize Hybridauth');
         }
     }
 }
Esempio n. 2
0
 public function process()
 {
     $output = '';
     if ($this->getProperty('hauth_start') || $this->getProperty('hauth_done')) {
         try {
             $storage = new Hybrid_Storage();
             // Check if Hybrid_Auth session already exist
             if (!$storage->config("CONFIG")) {
                 header("HTTP/1.0 404 Not Found");
                 return "You cannot access this page directly.";
             }
             Hybrid_Auth::initialize($storage->config("CONFIG"));
         } catch (Exception $e) {
             Hybrid_Logger::error("Endpoint: Error while trying to init Hybrid_Auth");
             header("HTTP/1.0 404 Not Found");
             return "Oophs. Error!";
         }
     }
     // If openid_policy requested, we return our policy document
     if ($this->getProperty('get') == "openid_policy") {
         $output = $this->processOpenidPolicy();
     } else {
         if ($this->getProperty('get') == "openid_xrds") {
             $output = $this->processOpenidXRDS();
         } else {
             if ($this->getProperty('hauth_start')) {
                 $output = $this->processAuthStart();
             } else {
                 if ($this->getProperty('hauth_done')) {
                     $output = $this->processAuthDone();
                 } else {
                     $output = $this->processOpenidRealm();
                 }
             }
         }
     }
     return $output;
 }
Esempio n. 3
0
 /**
  * Try to start a new session of none then initialize Hybrid_Auth
  * 
  * Hybrid_Auth constructor will require either a valid config array or
  * a path for a configuration file as parameter. To know more please 
  * refer to the Configuration section:
  * http://hybridauth.sourceforge.net/userguide/Configuration.html
  */
 function __construct($config)
 {
     if (!session_id()) {
         if (!session_start()) {
             throw new Exception("Hybridauth requires the use of 'session_start()' at the start of your script, which appears to be disabled.", 1);
         }
     }
     #{{{ well, should we check this each time? ..
     // PHP Curl extension [http://www.php.net/manual/en/intro.curl.php]
     if (!function_exists('curl_init')) {
         throw new Exception('Hybridauth Library needs the CURL PHP extension.');
     }
     // PHP JSON extension [http://php.net/manual/en/book.json.php]
     if (!function_exists('json_decode')) {
         throw new Exception('Hybridauth Library needs the JSON PHP extension.');
     }
     // OAuth PECL extension is not compatible with this library
     if (extension_loaded('oauth')) {
         throw new Exception('Hybridauth Library not compatible with installed PECL OAuth extension. Please disable it.');
     }
     #}}}
     Hybrid_Auth::initialize($config);
 }
Esempio n. 4
0
 /**
  * Try to start a new session of none then initialize Hybrid_Auth
  *
  * Hybrid_Auth constructor will require either a valid config array or
  * a path for a configuration file as parameter. To know more please
  * refer to the Configuration section:
  * http://hybridauth.sourceforge.net/userguide/Configuration.html
  */
 public function __construct($config)
 {
     Hybrid_Auth::initialize($config);
 }
Esempio n. 5
0
 public static function authInit()
 {
     if (!Hybrid_Endpoint::$initDone) {
         Hybrid_Endpoint::$initDone = TRUE;
         // Start a new session
         if (!session_id()) {
             session_start();
         }
         # Init Hybrid_Auth
         try {
             // Check if Hybrid_Auth session already exist
             if (!isset($_SESSION["HA::CONFIG"])) {
                 header("HTTP/1.0 404 Not Found");
                 die("You cannot access this page directly.");
             }
             Hybrid_Auth::initialize(unserialize($_SESSION["HA::CONFIG"]));
         } catch (Exception $e) {
             Hybrid_Logger::error("Endpoint: Error while trying to init Hybrid_Auth");
             header("HTTP/1.0 404 Not Found");
             die("Oophs. Error!");
         }
     }
 }
 /**
  * Try to start a new session of none then initialize Hybrid_Auth
  * 
  * Hybrid_Auth constructor will require either a valid config array or
  * a path for a configuration file as parameter. To know more please 
  * refer to the Configuration section:
  * http://hybridauth.sourceforge.net/userguide/Configuration.html
  */
 function __construct($config)
 {
     set_exception_handler(array($this, 'exceptionHandler'));
     Hybrid_Auth::initialize($config);
 }
Esempio n. 7
0
# if openid_xrds requested, we return our XRDS document
if (isset($_REQUEST["get"]) && $_REQUEST["get"] == "openid_xrds") {
    header("Content-Type: application/xrds+xml");
    echo str_replace("{RETURN_TO_URL}", Hybrid_Auth::getCurrentUrl(false), file_get_contents(dirname(__FILE__) . "/Hybrid/resources/openid_xrds.xml"));
    die;
}
# if we get a hauth.start or hauth.done
if (isset($_REQUEST["hauth_start"]) || isset($_REQUEST["hauth_done"])) {
    # init Hybrid_Auth
    try {
        // check if Hybrid_Auth session already exist
        if (!isset($_SESSION["HA::CONFIG"])) {
            header("HTTP/1.0 404 Not Found");
            die("You cannot access this page directly.");
        }
        Hybrid_Auth::initialize(unserialize($_SESSION["HA::CONFIG"]));
    } catch (Exception $e) {
        Hybrid_Logger::error("Endpoint: Error while trying to init Hybrid_Auth");
        header("HTTP/1.0 404 Not Found");
        die("Oophs. Error!");
    }
    Hybrid_Logger::info("Enter Endpoint");
    # define:endpoint step 3.
    # yeah, why not a switch!
    if (isset($_REQUEST["hauth_start"]) && $_REQUEST["hauth_start"]) {
        $provider_id = trim(strip_tags($_REQUEST["hauth_start"]));
        # check if page accessed directly
        if (!Hybrid_Auth::storage()->get("hauth_session.{$provider_id}.hauth_endpoint")) {
            Hybrid_Logger::error("Endpoint: hauth_endpoint parameter is not defined on hauth_start, halt login process!");
            header("HTTP/1.0 404 Not Found");
            die("You cannot access this page directly.");
Esempio n. 8
0
 public static function authInit()
 {
     if (!Hybrid_Endpoint::$initDone) {
         Hybrid_Endpoint::$initDone = TRUE;
         # Init Hybrid_Auth
         try {
             require_once realpath(dirname(__FILE__)) . "/Storage.php";
             $storage = new Hybrid_Storage();
             // Check if Hybrid_Auth session already exist
             if (!$storage->config("CONFIG")) {
                 header("HTTP/1.0 404 Not Found");
                 die("You cannot access this page directly.");
             }
             Hybrid_Auth::initialize($storage->config("CONFIG"));
         } catch (Exception $e) {
             Hybrid_Logger::error("Endpoint: Error while trying to init Hybrid_Auth");
             header("HTTP/1.0 404 Not Found");
             die("Oophs. Error!");
         }
     }
 }
Esempio n. 9
0
 /**
  * Initializes authentication
  * @throws Hybrid_Exception
  */
 protected function authInit()
 {
     if (!$this->initDone) {
         $this->initDone = true;
         // Init Hybrid_Auth
         try {
             if (!class_exists("Hybrid_Storage", false)) {
                 require_once realpath(dirname(__FILE__)) . "/Storage.php";
             }
             if (!class_exists("Hybrid_Exception", false)) {
                 require_once realpath(dirname(__FILE__)) . "/Exception.php";
             }
             if (!class_exists("Hybrid_Logger", false)) {
                 require_once realpath(dirname(__FILE__)) . "/Logger.php";
             }
             $storage = new Hybrid_Storage();
             // Check if Hybrid_Auth session already exist
             if (!$storage->config("CONFIG")) {
                 throw new Hybrid_Exception("You cannot access this page directly.");
             }
             Hybrid_Auth::initialize($storage->config("CONFIG"));
         } catch (Exception $e) {
             Hybrid_Logger::error("Endpoint: Error while trying to init Hybrid_Auth: " . $e->getMessage());
             throw new Hybrid_Exception("Endpoint: Error while trying to init Hybrid_Auth: " . $e->getMessage(), $e->getCode(), $e);
         }
     }
 }
Esempio n. 10
0
 public static function authInit()
 {
     if (!Hybrid_Endpoint::$initDone) {
         Hybrid_Endpoint::$initDone = TRUE;
         # Init Hybrid_Auth
         try {
             if (!class_exists("Hybrid_Storage")) {
                 require_once realpath(dirname(__FILE__)) . "/Storage.php";
             }
             $storage = new Hybrid_Storage();
             // Check if Hybrid_Auth session already exist
             if (!$storage->config("CONFIG")) {
                 throw new Hybrid_Exception("You cannot access this page directly.");
             }
             Hybrid_Auth::initialize($storage->config("CONFIG"));
         } catch (Exception $e) {
             Hybrid_Logger::error("Endpoint: Error while trying to init Hybrid_Auth: " . $e->getMessage());
             throw new Hybrid_Exception("Oophs. Error!");
         }
     }
 }
Esempio n. 11
0
 /**
  * Return the adapter instance for an authenticated provider
  */
 public static function getAdapter($providerId = NULL)
 {
     if (!Hybrid_Auth::$store) {
         require_once realpath(dirname(__FILE__)) . "/Storage.php";
         Hybrid_Auth::$store = new Hybrid_Storage();
     }
     if (!Hybrid_Auth::$config) {
         Hybrid_Auth::initialize(Hybrid_Auth::storage()->config("CONFIG"));
     }
     return Hybrid_Auth::setup($providerId);
 }
Esempio n. 12
0
 public static function authInit()
 {
     if (!Hybrid_Endpoint::$initDone) {
         Hybrid_Endpoint::$initDone = TRUE;
         # Init Hybrid_Auth
         try {
             $storage = new Hybrid_Storage();
             // Check if Hybrid_Auth session already exist
             if (!$storage->config("CONFIG")) {
                 throw new Hybrid_Exception("You cannot access this page directly.");
             }
             Hybrid_Auth::initialize($storage->config("CONFIG"));
         } catch (Exception $e) {
             throw new Hybrid_Exception("Oophs. Error!");
         }
     }
 }
Esempio n. 13
0
 /**
  * Initialize hybrid auth from configuration
  */
 public static function initializeHybridAuth()
 {
     \Hybrid_Auth::initialize(static::getConfiguration());
 }
Esempio n. 14
0
 public function hybridAction()
 {
     $ha_config = $this->_getHybridConfig();
     \Hybrid_Auth::initialize($ha_config);
     \Hybrid_Endpoint::process();
 }