OAuth-class(ROAuth)
OAuth-class()所属R语言包:ROAuth
Class "OAuth": A class to manage OAuth authentication
“的OAuth类:A类管理OAuth认证
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Class OAuth wraps and handles OAuth handshakes and signatures for the user within R
类OAuth包装和处理的OAuth的握手和签名的用户在R
Details
详细信息----------Details----------
The OAuth class is currently implemented as a reference class. An instance of a generator for this class is provided as a convenience to the user as it is configured to handle most standard cases. To access this generator, use the object OAuthFactory. See the examples section below for an example of how to instantiate an object of class OAuth.
目前已实施的OAuth类作为参考类。这个类的一个实例生成器,用于提供给用户一个方便,因为它被配置为处理最标准的情况下。要访问此生成器,使用对象OAuthFactory。 examples部分下面的一个例子,如何实例化一个对象类OAuth。
In almost all cases, saving an OAuth object after handshake and loading it into future sessions will allow it to remain authorized without needing any manual intervention that might have been performed initially, such as the PIN step with Twitter authentication.
在几乎所有的情况下,保存OAuth对象后握手,并加载到今后的会议将允许它继续,而无需任何人工干预可能已开始,,如PIN步骤与Twitter认证授权。
The needsVerifier argument is optional and defaults to TRUE. In almost all cases, the default should be used, the option is primarily provided to enable the examples as the keys provided by the examples are already signed. If you feel that you're in a situation where this should be set to FALSE, it's best to double check this.
needsVerifier参数是可选的,默认为TRUE。在几乎所有的情况下,应使用默认值,主要设置的选项,以使实施例,作为实施例所提供的键已经签署。如果你觉得你的情况下,这应该被设置为FALSE,这是最好仔细检查。
The signMethod to the handshake method tells the system which OAuth signature hash to use, one of HMAC for HMAC-SHA1 (default), RSA for RSA-SHA1 (not implemented), or text for plaintext.
signMethod到handshake方法的告诉系统OAuth的签名哈希使用,其中HMACHMAC-SHA1(默认),RSA<X >(未实施),或RSA-SHA1text。
The customHeader argument to OAuthRequest can be used to pass additional HTTP header commands to the underlying request.
customHeaderOAuthRequest的参数,可以用来传递额外的HTTP标头指令的基本要求。
The curl arguments can be used to provide a custom curl header, defaulting to a generic getCurlHandle call.
curl参数可用于提供一个自定义的卷曲头,默认为一个通用的getCurlHandle调用。
字段----------Fields----------
consumerKey: The consumer key provided by your application
consumerKey:消费者的关键应用程序提供的
consumerSecret: The consumer secret provided by your
consumerSecret:消费者秘密提供给您的
needsVerifier: Whether or not this OAuth needs
needsVerifier:不管这OAuth的需要
handshakeComplete: Whether or not the handshaking was
handshakeComplete:无论是握手
requestURL: The URL provided for retrieving request tokens
requestURL:所提供的URL获取请求令牌
authURL: The URL provided for
authURL:所提供的URL
accessURL: The URL provided for retrieving access tokens
accessURL:所提供的URL检索访问令牌
oauthKey: For internal use
oauthKey:仅供内部使用
oauthSecret: For internal use
oauthSecret:仅供内部使用
verifier: For internal use
verifier:仅供内部使用
signMethod: For internal use
signMethod:仅供内部使用
方法----------Methods----------
handshake(signMethod='HMAC', curl=getCurlHandle(), ...): Performs an OAuth handshake using the
handshake(signMethod='HMAC', curl=getCurlHandle(), ...):执行使用OAuth的握手
isVerified(): Returns the current verification status
isVerified():返回当前的验证状态
customHeader=NULL, curl=getCurlHandle(), ...):</dt> Will sign the URL provided and make an HTTP request using either POST or GET, determined by method, defaulting to GET. NOTE: The URL argument will be run through URLencode, so
,卷曲customHeader = NULL = getCurlHandle(),...)</ P>:</ DT>将签署提供的URL和一个HTTP请求使用的是POST或GET确定 method,默认为GET。注意:URL参数将贯穿URLencode,所以
initialize(needsVerifier, ...): For internal use
initialize(needsVerifier, ...):仅供内部使用
扩展----------Extends----------
All reference classes extend and inherit methods from "envRefClass".
所有引用类的扩展和继承方法"envRefClass"。
(作者)----------Author(s)----------
Jeff Gentry
参考文献----------References----------
参见----------See Also----------
setRefClass
setRefClass
实例----------Examples----------
## This example uses a test case from liboauth and the[#这个例子使用的测试的情况下从liboauth和]
## keys are already pre-signed. This is an example of[#键已经预先签署。这是一个例子的]
## one of the few times \code{needsVerifier} would be \code{FALSE}.[排名第1的为数不多的几次\的代码{needsVerifier} \代码{FALSE}。]
## Not run: [#不运行:]
reqURL <- "http://term.ie/oauth/example/request_token.php"
accessURL <- "http://term.ie/oauth/example/access_token.php"
authURL <- "NORMALLY YOU NEED THIS"
cKey <- "key"
cSecret <- "secret"
testURL <- "http://term.ie/oauth/example/echo_api.php?method=foo bar"
credentials <- OAuthFactory$new(consumerKey=cKey,
consumerSecret=cSecret,
requestURL=reqURL,
accessURL=accessURL,
authURL=authURL,
needsVerifier=FALSE)
credentials$handshake()
## the GET isn't strictly necessary as that's the default[#得到的不是绝对必要的,因为这是默认]
credentials$OAuthRequest(testURL, "GET")
## End(Not run)[#(不执行)]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|