当前位置: 首页>>代码示例>>PHP>>正文


PHP Hybrid_Auth::redirect方法代码示例

本文整理汇总了PHP中Hybrid_Auth::redirect方法的典型用法代码示例。如果您正苦于以下问题:PHP Hybrid_Auth::redirect方法的具体用法?PHP Hybrid_Auth::redirect怎么用?PHP Hybrid_Auth::redirect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Hybrid_Auth的用法示例。


在下文中一共展示了Hybrid_Auth::redirect方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: loginBegin

 /**
  * {@inheritdoc}
  */
 public function loginBegin()
 {
     // Initiate the Reverse Auth flow; cf. https://dev.twitter.com/docs/ios/using-reverse-auth
     if (isset($_REQUEST['reverse_auth']) && $_REQUEST['reverse_auth'] == 'yes') {
         $stage1 = $this->api->signedRequest($this->api->request_token_url, 'POST', array('x_auth_mode' => 'reverse_auth'));
         if ($this->api->http_code != 200) {
             throw new Exception("Authentication failed! {$this->providerId} returned an error. " . $this->errorMessageByStatus($this->api->http_code), 5);
         }
         $responseObj = array('x_reverse_auth_parameters' => $stage1, 'x_reverse_auth_target' => $this->config["keys"]["key"]);
         $response = json_encode($responseObj);
         header("Content-Type: application/json", true, 200);
         echo $response;
         die;
     }
     $tokens = $this->api->requestToken($this->endpoint);
     // request tokens as received from provider
     $this->request_tokens_raw = $tokens;
     // check the last HTTP status code returned
     if ($this->api->http_code != 200) {
         throw new Exception("Authentication failed! {$this->providerId} returned an error. " . $this->errorMessageByStatus($this->api->http_code), 5);
     }
     if (!isset($tokens["oauth_token"])) {
         throw new Exception("Authentication failed! {$this->providerId} returned an invalid oauth token.", 5);
     }
     $this->token("request_token", $tokens["oauth_token"]);
     $this->token("request_token_secret", $tokens["oauth_token_secret"]);
     // redirect the user to the provider authentication url with force_login
     if (isset($this->config['force_login']) && $this->config['force_login'] || isset($this->config['force']) && $this->config['force'] === true) {
         Hybrid_Auth::redirect($this->api->authorizeUrl($tokens, array('force_login' => true)));
     }
     // else, redirect the user to the provider authentication url
     Hybrid_Auth::redirect($this->api->authorizeUrl($tokens));
 }
开发者ID:kalypso63,项目名称:social_auth,代码行数:36,代码来源:Twitter.php

示例2: loginBegin

 /**
  * begin login step
  * 
  * simply call Facebook::require_login(). 
  */
 function loginBegin()
 {
     $parameters = array("scope" => $this->scope, "redirect_uri" => $this->endpoint, "display" => "page");
     $optionals = array("scope", "redirect_uri", "display", "auth_type");
     foreach ($optionals as $parameter) {
         if (isset($this->config[$parameter]) && !empty($this->config[$parameter])) {
             $parameters[$parameter] = $this->config[$parameter];
             //If the auth_type parameter is used, we need to generate a nonce and include it as a parameter
             if ($parameter == "auth_type") {
                 $nonce = md5(uniqid(mt_rand(), true));
                 $parameters['auth_nonce'] = $nonce;
                 Hybrid_Auth::storage()->set('fb_auth_nonce', $nonce);
             }
         }
     }
     if (isset($this->config['force']) && $this->config['force'] === true) {
         $parameters['auth_type'] = 'reauthenticate';
         $parameters['auth_nonce'] = md5(uniqid(mt_rand(), true));
         Hybrid_Auth::storage()->set('fb_auth_nonce', $parameters['auth_nonce']);
     }
     // get the login url
     $url = $this->api->getLoginUrl($parameters);
     // redirect to facebook
     Hybrid_Auth::redirect($url);
 }
开发者ID:FaddliLWibowo,项目名称:Social-Codeigniter,代码行数:30,代码来源:Facebook.php

示例3: loginBegin

 /**
  * begin login step
  * 
  * simply call Facebook::require_login(). 
  */
 function loginBegin()
 {
     // get the login url
     $url = $this->api->getLoginUrl(array('scope' => $this->scope, 'display' => $this->display, 'redirect_uri' => $this->endpoint));
     // redirect to facebook
     Hybrid_Auth::redirect($url);
 }
开发者ID:fandikurnia,项目名称:CiiMS,代码行数:12,代码来源:Facebook.php

示例4: loginBegin

 /**
  * begin login step 
  */
 function loginBegin()
 {
     # redirect to Authorize url
     //var_dump($this->api->getAuthorizeUrl());
     //die();
     Hybrid_Auth::redirect($this->api->getAuthorizeUrl());
 }
开发者ID:sandeepone,项目名称:reclaim-social-media,代码行数:10,代码来源:Soundcloud.php

示例5: loginBegin

 function loginBegin()
 {
     $parameters = array('scope' => isset($this->config['scope']) ? $this->config['scope'] : $this->scope, 'response_type' => 'token', 'client_id' => $this->api->client_id, 'redirect_uri' => $this->api->redirect_uri, 'state' => isset($this->config['state']) ? $this->config['state'] : '');
     if (is_array($parameters['scope'])) {
         $parameters['scope'] = implode(',', $parameters['scope']);
     }
     Hybrid_Auth::redirect($this->api->authorizeUrl($parameters));
 }
开发者ID:hybridauth,项目名称:hybridauth,代码行数:8,代码来源:Pinterest.php

示例6: loginBegin

 /**
  * {@inheritdoc}
  */
 function loginBegin()
 {
     $this->endpoint = $this->params['login_done'];
     $helper = $this->api->getRedirectLoginHelper();
     // Use re-request, because this will trigger permissions window if not all permissions are granted.
     $url = $helper->getReRequestUrl($this->endpoint, $this->scope);
     // Redirect to Facebook
     Hybrid_Auth::redirect($url);
 }
开发者ID:hybridauth,项目名称:hybridauth,代码行数:12,代码来源:Facebook.php

示例7: loginBegin

 /**
  * begin login step
  * 
  * simply call Renren::require_login(). 
  */
 function loginBegin()
 {
     $state = uniqid(null, true);
     $this->api->setPersistentData('state', $state);
     // get the login url
     $url = $this->api->getAuthorizeURL($this->endpoint, 'code', $state, "page");
     // redirect to Renren
     Hybrid_Auth::redirect($url);
 }
开发者ID:pingwangcs,项目名称:51zhaohu,代码行数:14,代码来源:Renren.php

示例8: loginBegin

 /**
  * begin login step 
  */
 function loginBegin()
 {
     try {
         $this->api->setRedirectURI($this->endpoint);
         $url = $this->api->getAuthorizationURL();
         Hybrid_Auth::redirect($url);
     } catch (ViadeoException $e) {
         throw new Exception("Authentication failed! An error occurred during {$this->providerId} authentication.", 5);
     }
 }
开发者ID:DonaldNgai,项目名称:PHPAuthentication,代码行数:13,代码来源:Viadeo.php

示例9: loginBegin

 function loginBegin()
 {
     $parameters = array();
     $optionals = array("redirect_uri");
     foreach ($optionals as $parameter) {
         if (isset($this->config[$parameter]) && !empty($this->config[$parameter])) {
             $parameters[$parameter] = $this->config[$parameter];
         }
     }
     Hybrid_Auth::redirect($this->api->authorizeUrl($parameters));
 }
开发者ID:hybridauth,项目名称:hybridauth,代码行数:11,代码来源:Dataporten.php

示例10: loginBegin

 /**
  * begin login step
  * 
  * simply call MyHeritage::require_login(). 
  */
 function loginBegin()
 {
     // if we have extra perm
     if (isset($this->config["scope"]) && !empty($this->config["scope"])) {
         $this->scope = $this->scope . ", " . $this->config["scope"];
     }
     // get the login url
     $url = $this->api->getLoginUrl(array('scope' => $this->scope, 'redirect_uri' => $this->endpoint));
     // redirect to MyHeritage
     Hybrid_Auth::redirect($url);
 }
开发者ID:rootsdev,项目名称:hybridauth-genealogy,代码行数:16,代码来源:MyHeritage.php

示例11: loginBegin

 /**
  * begin login step 
  */
 function loginBegin()
 {
     if (empty($this->openidIdentifier)) {
         throw new Exception("OpenID adapter require the identity provider identifier 'openid_identifier' as an extra parameter.", 4);
     }
     $this->api->identity = $this->openidIdentifier;
     $this->api->returnUrl = $this->endpoint;
     $this->api->required = array('namePerson/first', 'namePerson/last', 'namePerson/friendly', 'namePerson', 'contact/email', 'birthDate', 'birthDate/birthDay', 'birthDate/birthMonth', 'birthDate/birthYear', 'person/gender', 'pref/language', 'contact/postalCode/home', 'contact/city/home', 'contact/country/home', 'media/image/default');
     # redirect the user to the provider authentication url
     Hybrid_Auth::redirect($this->api->authUrl());
 }
开发者ID:naonak,项目名称:hybridauth,代码行数:14,代码来源:Provider_Model_OpenID.php

示例12: loginBegin

 /**
  * begin login step 
  */
 function loginBegin()
 {
     $parameters = array("scope" => $this->scope, "access_type" => "offline");
     $optionals = array("scope", "access_type", "redirect_uri", "approval_prompt", "hd");
     foreach ($optionals as $parameter) {
         if (isset($this->config[$parameter]) && !empty($this->config[$parameter])) {
             $parameters[$parameter] = $this->config[$parameter];
         }
     }
     Hybrid_Auth::redirect($this->api->authorizeUrl($parameters));
 }
开发者ID:Hoplite-Software,项目名称:observatory,代码行数:14,代码来源:Google.php

示例13: loginBegin

 /**
  * begin login step
  */
 function loginBegin()
 {
     if (!isset($this->state)) {
         $this->state = md5(uniqid(rand(), TRUE));
     }
     $this->saveState($this->state);
     $extra_params['state'] = $this->state;
     if (isset($this->scope)) {
         $extra_params['scope'] = $this->scope;
     }
     Hybrid_Auth::redirect($this->api->authorizeUrl($extra_params));
 }
开发者ID:siite,项目名称:choose-sa-cloud,代码行数:15,代码来源:DigitalOcean.php

示例14: loginBegin

 /**
  * begin login step
  */
 function loginBegin()
 {
     if (!isset($this->state)) {
         $this->state = md5(uniqid(rand(), TRUE));
     }
     $session_var_name = 'state_' . $this->api->client_id;
     $_SESSION[$session_var_name] = $this->state;
     $extra_params['state'] = $this->state;
     if (isset($this->scope)) {
         $extra_params['scope'] = $this->scope;
     }
     Hybrid_Auth::redirect($this->api->authorizeUrl($extra_params));
 }
开发者ID:davidbehler,项目名称:HybridAuth,代码行数:16,代码来源:DrupalOAuth2.php

示例15: loginBegin

 /**
  * begin login step
  *
  * simply call Facebook::require_login().
  */
 function loginBegin()
 {
     $parameters = array("scope" => $this->scope, "redirect_uri" => $this->endpoint, "display" => "page");
     $optionals = array("scope", "redirect_uri", "display");
     foreach ($optionals as $parameter) {
         if (isset($this->config[$parameter]) && !empty($this->config[$parameter])) {
             $parameters[$parameter] = $this->config[$parameter];
         }
     }
     // get the login url
     $url = $this->api->getLoginUrl($parameters);
     Hybrid_Auth::redirect($url);
 }
开发者ID:nickolanack,项目名称:joomla-hs-users,代码行数:18,代码来源:Facebook.php


注:本文中的Hybrid_Auth::redirect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。