Packagecom.yahoo.oauth
Classpublic class OAuthConnection

A utility class that wraps the entire OAuth signing mechanism over the Connection manager.



Public Properties
 PropertyDefined by
  consumer : OAuthConsumer
The OAuth consumer.
OAuthConnection
  realm : String
The service provider realm using in an "Authorization: OAuth..." header.
OAuthConnection
  requestType : String
The OAuth request type.
OAuthConnection
  signatureMethod : IOAuthSignatureMethod
The signature method to be used when signing the request.
OAuthConnection
  token : OAuthToken
The optional OAuth token.
OAuthConnection
  useExplicitEncoding : Boolean = true
Determines if the request parameters in the signature base string should be encoded using encodeURIComponent.
OAuthConnection
Public Methods
 MethodDefined by
  
Creates a new OAuthConnection object.
OAuthConnection
  
asyncRequest(httpMethod:String, url:String, callback:Object, args:Object = null, headers:Array = null):URLRequest
Sends a new HTTP request directly.
OAuthConnection
  
asyncRequestSigned(httpMethod:String, url:String, callback:Object, args:Object = null, headers:Array = null):URLRequest
Signs and sends a HTTP request using the OAuth consumer and token and the provided arguments.
OAuthConnection
  
[static] Returns a new OAuthConnection object for the specified OAuth consumer and token.
OAuthConnection
  
signRequest(httpMethod:String, url:String, args:Object = null):*
Signs a request using the provided method, URL and arguments.
OAuthConnection
Property detail
consumerproperty
consumer:OAuthConsumer  [read-write]

The OAuth consumer.

Implementation
    public function get consumer():OAuthConsumer
    public function set consumer(value:OAuthConsumer):void
realmproperty 
realm:String  [read-write]

The service provider realm using in an "Authorization: OAuth..." header.

Implementation
    public function get realm():String
    public function set realm(value:String):void
requestTypeproperty 
requestType:String  [read-write]

The OAuth request type.

Implementation
    public function get requestType():String
    public function set requestType(value:String):void
signatureMethodproperty 
signatureMethod:IOAuthSignatureMethod  [read-write]

The signature method to be used when signing the request.

Implementation
    public function get signatureMethod():IOAuthSignatureMethod
    public function set signatureMethod(value:IOAuthSignatureMethod):void
tokenproperty 
token:OAuthToken  [read-write]

The optional OAuth token.

Implementation
    public function get token():OAuthToken
    public function set token(value:OAuthToken):void
useExplicitEncodingproperty 
public var useExplicitEncoding:Boolean = true

Determines if the request parameters in the signature base string should be encoded using encodeURIComponent.

Constructor detail
OAuthConnection()constructor
public function OAuthConnection()

Creates a new OAuthConnection object.

Method detail
asyncRequest()method
public function asyncRequest(httpMethod:String, url:String, callback:Object, args:Object = null, headers:Array = null):URLRequest

Sends a new HTTP request directly.

Parameters
httpMethod:String — The URLRequestMethod to use in the request.
 
url:String — The URL to call in the URLRequest
 
callback:Object — An Object containing success, failure and security callback functions.
 
args:Object (default = null) — An Object, String, URLVariables or ByteArray to include in the URLRequest.data object.
 
headers:Array (default = null) — An Array of valid URLRequestHeader objects to be set in the URLRequest.requestHeaders property.

Returns
URLRequest — The URLRequest object generated.

See also

asyncRequestSigned()method 
public function asyncRequestSigned(httpMethod:String, url:String, callback:Object, args:Object = null, headers:Array = null):URLRequest

Signs and sends a HTTP request using the OAuth consumer and token and the provided arguments.

Parameters
httpMethod:String — The URLRequestMethod to use in the request.
 
url:String — The URL to call in the URLRequest
 
callback:Object — An Object containing success, failure and security callback functions.
 
args:Object (default = null) — An Object, String, URLVariables or ByteArray to include in the URLRequest.data object.
 
headers:Array (default = null) — An array of valid URLRequestHeader objects to be set in the URLRequest.requestHeaders property.

Returns
URLRequest — The URLRequest object generated.

See also

fromConsumerAndToken()method 
public static function fromConsumerAndToken(consumer:OAuthConsumer, token:OAuthToken = null):OAuthConnection

Returns a new OAuthConnection object for the specified OAuth consumer and token.

Parameters
consumer:OAuthConsumer — A consumer containing a key and secret used to identify an application making a request to the service provider.
 
token:OAuthToken (default = null) — An optional token containing a key and secret, used for signing three-legged requests.

Returns
OAuthConnection — A new OAuthConnection object.
signRequest()method 
public function signRequest(httpMethod:String, url:String, args:Object = null):*

Signs a request using the provided method, URL and arguments.

Parameters
httpMethod:String — The URLRequestMethod to use in the request.
 
url:String — The URL to request.
 
args:Object (default = null) — An object containing the parameters to be signed.

Returns
* — An object whose type is determined by the value of requestType.