當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Hybrid_Endpoint::process方法代碼示例

本文整理匯總了PHP中Hybrid_Endpoint::process方法的典型用法代碼示例。如果您正苦於以下問題:PHP Hybrid_Endpoint::process方法的具體用法?PHP Hybrid_Endpoint::process怎麽用?PHP Hybrid_Endpoint::process使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Hybrid_Endpoint的用法示例。


在下文中一共展示了Hybrid_Endpoint::process方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getGoogleLogin

 public function getGoogleLogin($auth = NULL)
 {
     if ($auth == 'auth') {
         Hybrid_Endpoint::process();
     }
     try {
         $oauth = new Hybrid_Auth(app_path() . '/config/google_auth.php');
         $provider = $oauth->authenticate('Google');
         $profile = $provider->getUserProfile();
     } catch (exception $e) {
         return $e->getMessage();
     }
     if ($user = User::where('email', '=', $profile->email)->first()) {
         Auth::login($user, true);
         return Redirect::intended('/');
     }
     return App::make('frontend\\UserController')->doSignUp(array('email' => $profile->email, 'login' => $profile->identifier, 'password' => "pass1234", 'f_name' => $profile->firstName, 'l_name' => $profile->lastName));
 }
開發者ID:netfox01,項目名稱:exprime,代碼行數:18,代碼來源:AuthController.php

示例2: loginAction

 public function loginAction()
 {
     \Hybrid_Endpoint::process();
 }
開發者ID:campaignchain,項目名稱:security-authentication-client-oauth,代碼行數:4,代碼來源:OAuthController.php

示例3: createLoginProviderEntity

 /**
  * @return LoginProviderEntity
  */
 protected function createLoginProviderEntity()
 {
     $type = $this->getHybridType();
     //dump($this->getCallbackUrl());die($this->getCallbackUrl());
     $params = array('base_url' => $this->getCallbackUrl(), 'providers' => array($type => $this->getConfig() + array('enabled' => TRUE)));
     $hybridauth = new \Hybrid_Auth($params);
     if (isset($_REQUEST['hauth_start']) || isset($_REQUEST['hauth_done'])) {
         \Hybrid_Endpoint::process();
     }
     /** @var \Hybrid_User_Profile $user */
     $user = $hybridauth->authenticate($this->getHybridType(), $this->authenticationParameters)->getUserProfile();
     $ret = new LoginProviderEntity($user->identifier, static::getType());
     return $ret;
 }
開發者ID:venne,項目名稱:hybridauth-module,代碼行數:17,代碼來源:AbstractLogin.php

示例4: loginWithSocial

 public function loginWithSocial($social_provider, $action = "")
 {
     // check URL segment
     if ($action == "auth") {
         // process authentication
         try {
             Session::set('provider', $social_provider);
             Hybrid_Endpoint::process();
         } catch (Exception $e) {
             // redirect back to http://URL/social/
             return Redirect::route('loginWith');
         }
         return;
     }
     try {
         // create a HybridAuth object
         $socialAuth = new Hybrid_Auth(app_path() . '/config/hybridauth.php');
         // authenticate with Provider
         $provider = $socialAuth->authenticate($social_provider);
         // fetch user profile
         $userProfile = $provider->getUserProfile();
     } catch (Exception $e) {
         // exception codes can be found on HybBridAuth's web site
         Session::flash('error_msg', $e->getMessage());
         return Redirect::to('/login');
     }
     $this->createOAuthProfile($userProfile);
     return Redirect::to('/');
 }
開發者ID:noikiy,項目名稱:Secure-Authentication-System-Laravel,代碼行數:29,代碼來源:LoginController.php

示例5: endpoint

 function endpoint()
 {
     jimport('hs.user.lib.Hybrid.Auth');
     jimport('hs.user.lib.Hybrid.Endpoint');
     // require_once (JPATH_COMPONENT_SITE . '/lib/Hybrid/Auth.php');
     // require_once (JPATH_COMPONENT_SITE . '/lib/Hybrid/Endpoint.php');
     Hybrid_Endpoint::process();
 }
開發者ID:nickolanack,項目名稱:joomla-hs-users,代碼行數:8,代碼來源:authentications.php

示例6: indexAction

 public function indexAction()
 {
     ob_start();
     echo "<pre>";
     print_r(\Hybrid_Endpoint::process());
     exit;
     ob_end_flush();
 }
開發者ID:aapthi,項目名稱:video-collections,代碼行數:8,代碼來源:HybridAuthController.php

示例7: processEndpoint

 /**
  * process the 
  * 
  * @return string
  */
 public function processEndpoint()
 {
     //App::import('Vendor', 'hybridauth/Hybrid/Endpoint');
     require_once ROOT . DS . 'vendor' . DS . 'hybridauth' . DS . 'hybridauth' . DS . 'hybridauth' . DS . 'Hybrid' . DS . 'Endpoint.php';
     if (!$this->hybridauth) {
         $this->init();
     }
     \Hybrid_Endpoint::process();
 }
開發者ID:ngdinhbinh,項目名稱:libu,代碼行數:14,代碼來源:HybridauthComponent.php

示例8: getAuth

 public function getAuth()
 {
     try {
         \Hybrid_Endpoint::process();
     } catch (\Exception $e) {
         // redirect back to http://URL/social/
         //return Redirect::to('social');
     }
     return;
 }
開發者ID:juanjolainez,項目名稱:SecondLife,代碼行數:10,代碼來源:ApiController.php

示例9: hybrid

 public function hybrid($provider)
 {
     if (isset($_REQUEST['hauth_start']) || isset($_REQUEST['hauth_done'])) {
         \Hybrid_Endpoint::process();
     }
     try {
         // create an instance for Hybridauth with the configuration file path as parameter
         // try to authenticate the user with twitter,
         // user will be redirected to Twitter for authentication,
         // if he already did, then Hybridauth will ignore this step and return an instance of the adapter
         $this->provider = $this->hybrid_auth->authenticate(ucfirst($provider));
         var_dump($this->provider);
         die;
         // get the user profile
         $twitter_user_profile = $this->provider->getUserProfile();
         var_dump($twitter_user_profile);
         die;
         $this->session->set('auth-identity', array('id' => $twitter_user_profile->identifier, 'username' => $twitter_user_profile->displayName, 'pic' => $twitter_user_profile->photoURL));
         //return $this->response->redirect('');
     } catch (\Exception $e) {
         // Display the recived error,
         // to know more please refer to Exceptions handling section on the userguide
         switch ($e->getCode()) {
             case 0:
                 echo "Unspecified error.";
                 break;
             case 1:
                 echo "Hybriauth configuration error.";
                 break;
             case 2:
                 echo "Provider not properly configured.";
                 break;
             case 3:
                 echo "Unknown or disabled provider.";
                 break;
             case 4:
                 echo "Missing provider application credentials.";
                 break;
             case 5:
                 echo "Authentification failed. The user has canceled the authentication or the provider refused the connection.";
                 break;
             case 6:
                 echo "User profile request failed. Most likely the user is not connected to the provider and he should authenticate again.";
                 $this->provider->logout();
                 break;
             case 7:
                 echo "User not connected to the provider.";
                 $this->provider->logout();
                 break;
             case 8:
                 echo "Provider does not support this feature.";
                 break;
         }
     }
 }
開發者ID:tienrocker,項目名稱:pauthentication,代碼行數:55,代碼來源:auth.php

示例10: login

 public function login($account)
 {
     if (isset($_REQUEST['hauth_start']) || isset($_REQUEST['hauth_done'])) {
         Hybrid_Endpoint::process();
     }
     $authAdapter = $this->service->authenticate($account);
     if ($authAdapter) {
         return $this->user->login($authAdapter->getUserProfile()->email);
     }
     return null;
 }
開發者ID:asalov,項目名稱:vehicles_network,代碼行數:11,代碼來源:AuthModel.php

示例11: login

 public function login(\Hybrid_Auth $hybridAuth, $action = '')
 {
     try {
         switch ($action) {
             case 'auth':
                 \Hybrid_Endpoint::process();
                 return;
             case 'openid-google':
                 $hybridAuthProvider = $hybridAuth->authenticate('openid', ['openid_identifier' => 'http://www.google.com/accounts/o8/id']);
                 $hybridAuthUserProfile = $hybridAuthProvider->getUserProfile();
                 $user = User::firstOrCreate(['authenticator' => 'openid', 'authenticator_credential' => $hybridAuthUserProfile->identifier]);
                 break;
             case 'openid-yahoo':
                 $hybridAuthProvider = $hybridAuth->authenticate('openid', ['openid_identifier' => 'http://my.yahoo.com']);
                 $hybridAuthUserProfile = $hybridAuthProvider->getUserProfile();
                 $user = User::firstOrCreate(['authenticator' => 'openid', 'authenticator_credential' => $hybridAuthUserProfile->identifier]);
                 break;
             case 'google':
                 $hybridAuthProvider = $hybridAuth->authenticate('google');
                 $hybridAuthUserProfile = $hybridAuthProvider->getUserProfile();
                 $user = User::firstOrCreate(['authenticator' => 'openid', 'authenticator_credential' => $hybridAuthUserProfile->identifier]);
                 break;
             case 'facebook':
                 $hybridAuthProvider = $hybridAuth->authenticate('facebook');
                 $hybridAuthUserProfile = $hybridAuthProvider->getUserProfile();
                 $user = User::firstOrCreate(['authenticator' => 'facebook', 'authenticator_credential' => $hybridAuthUserProfile->identifier]);
                 break;
             case 'twitter':
                 $hybridAuthProvider = $hybridAuth->authenticate('twitter');
                 $hybridAuthUserProfile = $hybridAuthProvider->getUserProfile();
                 $user = User::firstOrCreate(['authenticator' => 'twitter', 'authenticator_credential' => $hybridAuthUserProfile->identifier]);
                 break;
             default:
                 $hybridAuthProvider = $hybridAuth->authenticate('openid', ['openid_identifier' => $action]);
                 $hybridAuthUserProfile = $hybridAuthProvider->getUserProfile();
                 $user = User::firstOrCreate(['authenticator' => 'openid', 'authenticator_credential' => $hybridAuthUserProfile->identifier]);
                 break;
         }
         \Session::put('userid', $user->id);
         // TODO: Return to the index page
     } catch (Exception $ex) {
         // TODO: Return error to the login form
     }
 }
開發者ID:JonTheNiceGuy,項目名稱:cchits.laravel,代碼行數:44,代碼來源:LoginController.php

示例12: getLoginFacebook

 public function getLoginFacebook($auth = NULL)
 {
     if ($auth == 'auth') {
         try {
             \Hybrid_Endpoint::process();
         } catch (Exception $e) {
             return Redirect::to("home");
         }
         return;
     }
     $config = array("base_url" => "http://laravel/public/", "providers" => array("Facebook" => array("enabled" => true, "keys" => array("id" => "488919314589569", "secret" => "2b8ab46fece7bef72c48abe0eaa664d0"), "scope" => "public_profile,email", "display" => "popup")));
     $oauth = new \Hybrid_Auth($config);
     $provider = $oauth->authenticate("Facebook");
     $profile = $provider->getUserProfile();
     var_dump($profile);
     echo "FirstName:" . $profile->firstName . "<br>";
     echo "Email:" . $profile->email;
     echo "<br><a href='logout'>Logout</a> ";
 }
開發者ID:olax,項目名稱:epetitions,代碼行數:19,代碼來源:LoginController.php

示例13: hybridlogin

 /**
  * Login using hybrid auth.
  */
 function hybridlogin($provider)
 {
     if (isset($_REQUEST['hauth_start']) || isset($_REQUEST['hauth_done'])) {
         Hybrid_Endpoint::process();
         exit;
     }
     $config = array("base_url" => RewriteUtil::getBaseUrl() . "main/hybridlogin?provider=" . $provider, "providers" => array());
     if (isset($this->config["facebookAppId"])) {
         $config["providers"]["Facebook"] = array("enabled" => true, "trustForwarded" => false, "scope" => "email", "keys" => array("id" => $this->config["facebookAppId"], "secret" => $this->config["facebookSecret"]));
     }
     $hybridauth = new Hybrid_Auth($config);
     try {
         $auth = $hybridauth->authenticate($provider);
         $profile = $auth->getUserProfile();
         $_SESSION["email"] = $profile->email;
         $this->redirect();
     } catch (Exception $e) {
         $this->showLoginForm($e->getMessage());
     }
 }
開發者ID:derickp,項目名稱:swag,代碼行數:23,代碼來源:MainController.php

示例14: process

 public static function process($request = NULL)
 {
     // Setup request variable
     Hybrid_Endpoint::$request = $request;
     if (is_null(Hybrid_Endpoint::$request)) {
         // Fix a strange behavior when some provider call back ha endpoint
         // with /index.php?hauth.done={provider}?{args}...
         // >here we need to recreate the $_REQUEST
         if (strrpos($_SERVER["QUERY_STRING"], '?')) {
             $_SERVER["QUERY_STRING"] = str_replace("?", "&", $_SERVER["QUERY_STRING"]);
             parse_str($_SERVER["QUERY_STRING"], $_REQUEST);
         }
         Hybrid_Endpoint::$request = $_REQUEST;
     }
     // If we get a hauth.start
     if (isset(WSL_Hybrid_Endpoint::$request["hauth_start"]) && WSL_Hybrid_Endpoint::$request["hauth_start"]) {
         return WSL_Hybrid_Endpoint::processAuthStart();
     } elseif (isset(WSL_Hybrid_Endpoint::$request["hauth_done"]) && WSL_Hybrid_Endpoint::$request["hauth_done"]) {
         return WSL_Hybrid_Endpoint::processAuthDone();
     }
     parent::process($request);
 }
開發者ID:Vatia13,項目名稱:dancesport,代碼行數:22,代碼來源:WSL_Endpoint.php

示例15:

<?php

/*!
* HybridAuth
* http://hybridauth.sourceforge.net | https://github.com/hybridauth/hybridauth
*  (c) 2009-2011 HybridAuth authors | hybridauth.sourceforge.net/licenses.html
*/
// ------------------------------------------------------------------------
//	HybridAuth End Point
// ------------------------------------------------------------------------
require_once "Hybrid/Auth.php";
require_once "Hybrid/Endpoint.php";
Hybrid_Endpoint::process();
開發者ID:mafiu,項目名稱:listapp,代碼行數:13,代碼來源:index.php


注:本文中的Hybrid_Endpoint::process方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。