• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Auth_OpenID_ServiceEndpointLoader类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: prepareForSave

 function prepareForSave($obj)
 {
     $loader = new Auth_OpenID_ServiceEndpointLoader();
     $services = array();
     foreach ($obj->services as $s) {
         $services[] = $loader->toSession($s);
     }
     return array('services' => $services);
 }
开发者ID:LeeGlendenning,项目名称:formulize,代码行数:9,代码来源:Manager.php


示例2: complete

 /**
  * Called to interpret the server's response to an OpenID
  * request. It is called in step 4 of the flow described in the
  * consumer overview.
  *
  * @param string $current_url The URL used to invoke the application.
  * Extract the URL from your application's web
  * request framework and specify it here to have it checked
  * against the openid.current_url value in the response.  If
  * the current_url URL check fails, the status of the
  * completion will be FAILURE.
  *
  * @param array $query An array of the query parameters (key =>
  * value pairs) for this HTTP request.  Defaults to null.  If
  * null, the GET or POST data are automatically gotten from the
  * PHP environment.  It is only useful to override $query for
  * testing.
  *
  * @return Auth_OpenID_ConsumerResponse $response A instance of an
  * Auth_OpenID_ConsumerResponse subclass. The type of response is
  * indicated by the status attribute, which will be one of
  * SUCCESS, CANCEL, FAILURE, or SETUP_NEEDED.
  */
 function complete($current_url, $query = null)
 {
     if ($current_url && !is_string($current_url)) {
         // This is ugly, but we need to complain loudly when
         // someone uses the API incorrectly.
         trigger_error("current_url must be a string; see NEWS file " . "for upgrading notes.", E_USER_ERROR);
     }
     if ($query === null) {
         $query = Auth_OpenID::getQuery();
     }
     $loader = new Auth_OpenID_ServiceEndpointLoader();
     $endpoint_data = $this->session->get($this->_token_key);
     $endpoint = $loader->fromSession($endpoint_data);
     $message = Auth_OpenID_Message::fromPostArgs($query);
     $response = $this->consumer->complete($message, $endpoint, $current_url);
     $this->session->del($this->_token_key);
     if (in_array($response->status, array(Auth_OpenID_SUCCESS, Auth_OpenID_CANCEL))) {
         if ($response->identity_url !== null) {
             $disco = $this->getDiscoveryObject($this->session, $response->identity_url, $this->session_key_prefix);
             $disco->cleanup(true);
         }
     }
     return $response;
 }
开发者ID:raphox,项目名称:php-openid,代码行数:47,代码来源:Consumer.php


示例3: complete

 /**
  * Called to interpret the server's response to an OpenID
  * request. It is called in step 4 of the flow described in the
  * consumer overview.
  *
  * @param array $query An array of the query parameters (key =>
  * value pairs) for this HTTP request.
  *
  * @return Auth_OpenID_ConsumerResponse $response A instance of an
  * Auth_OpenID_ConsumerResponse subclass. The type of response is
  * indicated by the status attribute, which will be one of
  * SUCCESS, CANCEL, FAILURE, or SETUP_NEEDED.
  */
 function complete($query)
 {
     $query = Auth_OpenID::fixArgs($query);
     $loader = new Auth_OpenID_ServiceEndpointLoader();
     $endpoint_data = $this->session->get($this->_token_key);
     $endpoint = $loader->fromSession($endpoint_data);
     if ($endpoint === null) {
         $response = new Auth_OpenID_FailureResponse(null, 'No session state found');
     } else {
         $response = $this->consumer->complete($query, $endpoint);
         $this->session->del($this->_token_key);
     }
     if (in_array($response->status, array(Auth_OpenID_SUCCESS, Auth_OpenID_CANCEL))) {
         if ($response->identity_url !== null) {
             $disco = new Services_Yadis_Discovery($this->session, $response->identity_url, $this->session_key_prefix);
             $disco->cleanup();
         }
     }
     return $response;
 }
开发者ID:JJYing,项目名称:Anyway-Website,代码行数:33,代码来源:Consumer.php


示例4: test_beginWithoutDiscovery

 function test_beginWithoutDiscovery()
 {
     // Does this really test anything non-trivial?
     $result = $this->consumer->beginWithoutDiscovery($this->endpoint);
     // The result is an auth request
     $this->assertTrue(strtolower(get_class($result)) == 'auth_openid_authrequest');
     $loader = new Auth_OpenID_ServiceEndpointLoader();
     // Side-effect of calling beginWithoutDiscovery is setting the
     // session value to the endpoint attribute of the result
     $this->assertTrue($loader->fromSession($this->session->get($this->consumer->_token_key)) == $result->endpoint);
     // The endpoint that we passed in is the endpoint on the
     // auth_request
     $this->assertTrue($result->endpoint == $this->endpoint);
 }
开发者ID:umbecr,项目名称:camilaframework,代码行数:14,代码来源:Consumer.php


示例5: complete

 /**
  * Called to interpret the server's response to an OpenID
  * request. It is called in step 4 of the flow described in the
  * consumer overview.
  *
  * @param string $current_url The URL used to invoke the application.
  * Extract the URL from your application's web
  * request framework and specify it here to have it checked
  * against the openid.current_url value in the response.  If
  * the current_url URL check fails, the status of the
  * completion will be FAILURE.
  *
  * @param array $query An array of the query parameters (key =>
  * value pairs) for this HTTP request.  Defaults to null.  If
  * null, the GET or POST data are automatically gotten from the
  * PHP environment.  It is only useful to override $query for
  * testing.
  *
  * @return Auth_OpenID_ConsumerResponse $response A instance of an
  * Auth_OpenID_ConsumerResponse subclass. The type of response is
  * indicated by the status attribute, which will be one of
  * SUCCESS, CANCEL, FAILURE, or SETUP_NEEDED.
  */
 function complete($current_url, $query = null)
 {
     if ($current_url && !is_string($current_url)) {
         // This is ugly, but we need to complain loudly when
         // someone uses the API incorrectly.
         trigger_error("current_url must be a string; see NEWS file " . "for upgrading notes.", E_USER_ERROR);
     }
     if ($query === null) {
         $query = Auth_OpenID::getQuery();
         if (empty($query)) {
             error_log('/lib/openid/Auth/OpenID/Consumer.php::complete() - warning: empty query string!');
             if (isset($_SERVER['HTTP_REFERER']) && ($argpos = strpos($_SERVER['HTTP_REFERER'], '?')) !== false) {
                 $query = Auth_OpenID::getQuery(substr($_SERVER['HTTP_REFERER'], $argpos + 1));
             }
         }
     }
     $loader = new Auth_OpenID_ServiceEndpointLoader();
     $endpoint_data = $this->session->get($this->_token_key);
     $endpoint = $loader->fromSession($endpoint_data);
     $message = Auth_OpenID_Message::fromPostArgs($query);
     $response = $this->consumer->complete($message, $endpoint, $current_url);
     $this->session->del($this->_token_key);
     if (in_array($response->status, array(Auth_OpenID_SUCCESS, Auth_OpenID_CANCEL))) {
         if ($response->identity_url !== null) {
             $disco = $this->getDiscoveryObject($this->session, $response->identity_url, $this->session_key_prefix);
             $disco->cleanup(true);
         }
     }
     return $response;
 }
开发者ID:remotelearner,项目名称:elis.openid,代码行数:53,代码来源:Consumer.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Auth_OpenID_TrustRoot类代码示例发布时间:2022-05-23
下一篇:
PHP Auth_OpenID_ServiceEndpoint类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap