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


PHP Auth_OpenID_KVForm類代碼示例

本文整理匯總了PHP中Auth_OpenID_KVForm的典型用法代碼示例。如果您正苦於以下問題:PHP Auth_OpenID_KVForm類的具體用法?PHP Auth_OpenID_KVForm怎麽用?PHP Auth_OpenID_KVForm使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: Auth_OpenID_associate

function Auth_OpenID_associate($qs, $assoc_secret, $assoc_handle)
{
    $query_data = Auth_OpenID_parse($qs);
    assert(count($query_data) == 6 || count($query_data) == 4);
    assert($query_data['openid.mode'] == 'associate');
    assert($query_data['openid.assoc_type'] == 'HMAC-SHA1');
    assert($query_data['openid.session_type'] == 'DH-SHA1');
    $reply_dict = array('assoc_type' => 'HMAC-SHA1', 'assoc_handle' => $assoc_handle, 'expires_in' => '600');
    $dh_args = Auth_OpenID_DiffieHellman::serverAssociate($query_data, $assoc_secret);
    $reply_dict = array_merge($reply_dict, $dh_args);
    return Auth_OpenID_KVForm::fromArray($reply_dict);
}
開發者ID:aprilchild,項目名稱:aprilchild,代碼行數:12,代碼來源:Consumer.php

示例2: Auth_OpenID_associate

function Auth_OpenID_associate($qs, $assoc_secret, $assoc_handle)
{
    $query_data = Auth_OpenID_parse($qs);
    assert($query_data['openid.mode'] == 'associate');
    assert($query_data['openid.assoc_type'] == 'HMAC-SHA1');
    $reply_dict = array('assoc_type' => 'HMAC-SHA1', 'assoc_handle' => $assoc_handle, 'expires_in' => '600');
    if (defined('Auth_OpenID_NO_MATH_SUPPORT')) {
        assert(count($query_data) == 2);
        $message = Auth_OpenID_Message::fromPostArgs($query_data);
        $session = Auth_OpenID_PlainTextServerSession::fromMessage($message);
    } else {
        assert(count($query_data) == 6 || count($query_data) == 4);
        assert($query_data['openid.mode'] == 'associate');
        assert($query_data['openid.session_type'] == 'DH-SHA1');
        $message = Auth_OpenID_Message::fromPostArgs($query_data);
        $session = Auth_OpenID_DiffieHellmanSHA1ServerSession::fromMessage($message);
        $reply_dict['session_type'] = 'DH-SHA1';
    }
    $reply_dict = array_merge($reply_dict, $session->answer($assoc_secret));
    return Auth_OpenID_KVForm::fromArray($reply_dict);
}
開發者ID:umbecr,項目名稱:camilaframework,代碼行數:21,代碼來源:Consumer.php

示例3: encodeToKVForm

	/**
	 * Encodes the response to key-value form.  This is a
	 * machine-readable format used to respond to messages which came
	 * directly from the consumer and not through the user-agent.  See
	 * the OpenID specification.
	 */
	function encodeToKVForm()
	{
		return Auth_OpenID_KVForm::fromArray(
		array('mode' => 'error',
                                            'error' => $this->toString()));
	}
開發者ID:hoalangoc,項目名稱:ftf,代碼行數:12,代碼來源:Server.php

示例4: sign

 /**
  * Generate a signature for a sequence of (key, value) pairs
  *
  * @access private
  * @param array $pairs The pairs to sign, in order.  This is an
  * array of two-tuples.
  * @return string $signature The binary signature of this sequence
  * of pairs
  */
 function sign($pairs)
 {
     $kv = Auth_OpenID_KVForm::fromArray($pairs);
     /* Invalid association types should be caught at constructor */
     $callback = $this->_macs[$this->assoc_type];
     return call_user_func_array($callback, array($this->secret, $kv));
 }
開發者ID:hilkeros,項目名稱:MMM-php-cake,代碼行數:16,代碼來源:Association.php

示例5: toKVForm

 function toKVForm()
 {
     // Generate a KVForm string that contains the parameters in
     // this message. This will fail if the message contains
     // arguments outside of the 'openid.' prefix.
     return Auth_OpenID_KVForm::fromArray($this->toArgs());
 }
開發者ID:BackupTheBerlios,項目名稱:oos-svn,代碼行數:7,代碼來源:Message.php

示例6: encodeToKVForm

 function encodeToKVForm()
 {
     return Auth_OpenID_KVForm::fromArray($this->fields);
 }
開發者ID:Fellah,項目名稱:govnobaki,代碼行數:4,代碼來源:Server.php

示例7: _runTest

 function _runTest()
 {
     $serialized = Auth_OpenID_KVForm::fromArray($this->arr);
     $this->assertTrue($serialized === null, 'serialization unexpectedly succeeded');
 }
開發者ID:Stony-Brook-University,項目名稱:doitsbu,代碼行數:5,代碼來源:KVForm.php

示例8: _makeKVPost

 /**
  * @access private
  */
 function _makeKVPost($args, $server_url)
 {
     $mode = $args['openid.mode'];
     $pairs = array();
     foreach ($args as $k => $v) {
         $v = urlencode($v);
         $pairs[] = "{$k}={$v}";
     }
     $body = implode("&", $pairs);
     $resp = $this->fetcher->post($server_url, $body);
     if ($resp === null) {
         return null;
     }
     $response = Auth_OpenID_KVForm::toArray($resp->body);
     if ($resp->status == 400) {
         return null;
     } else {
         if ($resp->status != 200) {
             return null;
         }
     }
     return $response;
 }
開發者ID:JJYing,項目名稱:Anyway-Website,代碼行數:26,代碼來源:Consumer.php

示例9: sign

 /**
  * Generate a signature for a sequence of (key, value) pairs
  *
  * @access private
  * @param array $pairs The pairs to sign, in order.  This is an
  * array of two-tuples.
  * @return string $signature The binary signature of this sequence
  * of pairs
  */
 function sign($pairs)
 {
     $kv = Auth_OpenID_KVForm::fromArray($pairs);
     return Auth_OpenID_HMACSHA1($this->secret, $kv);
 }
開發者ID:Tjorriemorrie,項目名稱:app,代碼行數:14,代碼來源:Association.php


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