OAuth::__construct
(PECL OAuth >= 0.99.1)
OAuth::__construct — 新建一个 OAuth 对象
说明
public OAuth::__construct(
string
string
string
int
)
string
$consumer_key
,string
$consumer_secret
,string
$signature_method
= OAUTH_SIG_METHOD_HMACSHA1
,int
$auth_type
= 0)
新建一个 OAuth 对象
参数
-
consumer_key
-
由服务提供者提供的 consumer key 。
-
consumer_secret
-
由服务提供者提供的 consumer secret 。
-
signature_method
-
可选参数,用来定义使用哪种签名方法,默认为
OAUTH_SIG_METHOD_HMACSHA1
(HMAC-SHA1)。 -
auth_type
-
可选参数,用来定义如何传递 OAuth 参数给消费方,默认为
OAUTH_AUTH_TYPE_AUTHORIZATION
(在Authorization
头部)。

User Contributed Notes 2 notes
mgfrobozz at gmail dot com ¶
5 years ago
The signature methods available as of oauth-1.2.3 are:
OAUTH_SIG_METHOD_HMACSHA1
OAUTH_SIG_METHOD_HMACSHA256
OAUTH_SIG_METHOD_RSASHA1
OAUTH_SIG_METHOD_PLAINTEXT
mgfrobozz at gmail dot com ¶
5 years ago
The authorization type enums as of oauth-1.2.3 are
OAUTH_AUTH_TYPE_AUTHORIZATION
OAUTH_AUTH_TYPE_URI
OAUTH_AUTH_TYPE_FORM
OAUTH_AUTH_TYPE_NONE