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


PHP Auth_OpenID_ServiceEndpoint::fromOPEndpointURL方法代碼示例

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


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

示例1: _verifyDiscoveryResultsOpenID2

 /**
  * @access private
  */
 function _verifyDiscoveryResultsOpenID2($message, $endpoint)
 {
     $to_match = new Auth_OpenID_ServiceEndpoint();
     $to_match->type_uris = array(Auth_OpenID_TYPE_2_0);
     $to_match->claimed_id = $message->getArg(Auth_OpenID_OPENID2_NS, 'claimed_id');
     $to_match->local_id = $message->getArg(Auth_OpenID_OPENID2_NS, 'identity');
     $to_match->server_url = $message->getArg(Auth_OpenID_OPENID2_NS, 'op_endpoint');
     if ($to_match->server_url === null) {
         return new Auth_OpenID_FailureResponse($endpoint, "OP Endpoint URL missing");
     }
     // claimed_id and identifier must both be present or both be
     // absent
     if ($to_match->claimed_id === null && $to_match->local_id !== null) {
         return new Auth_OpenID_FailureResponse($endpoint, 'openid.identity is present without openid.claimed_id');
     }
     if ($to_match->claimed_id !== null && $to_match->local_id === null) {
         return new Auth_OpenID_FailureResponse($endpoint, 'openid.claimed_id is present without openid.identity');
     }
     if ($to_match->claimed_id === null) {
         // This is a response without identifiers, so there's
         // really no checking that we can do, so return an
         // endpoint that's for the specified `openid.op_endpoint'
         return Auth_OpenID_ServiceEndpoint::fromOPEndpointURL($to_match->server_url);
     }
     if (!$endpoint) {
         // The claimed ID doesn't match, so we have to do
         // discovery again. This covers not using sessions, OP
         // identifier endpoints and responses that didn't match
         // the original request.
         // oidutil.log('No pre-discovered information supplied.')
         return $this->_discoverAndVerify($to_match->claimed_id, array($to_match));
     } else {
         // The claimed ID matches, so we use the endpoint that we
         // discovered in initiation. This should be the most
         // common case.
         $result = $this->_verifyDiscoverySingle($endpoint, $to_match);
         if (Auth_OpenID::isFailure($result)) {
             $endpoint = $this->_discoverAndVerify($to_match->claimed_id, array($to_match));
             if (Auth_OpenID::isFailure($endpoint)) {
                 return $endpoint;
             }
         }
     }
     // The endpoint we return should have the claimed ID from the
     // message we just verified, fragment and all.
     if ($endpoint->claimed_id != $to_match->claimed_id) {
         $endpoint->claimed_id = $to_match->claimed_id;
     }
     return $endpoint;
 }
開發者ID:raphox,項目名稱:php-openid,代碼行數:53,代碼來源:Consumer.php


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