Packagecom.swfjunkie.tweetr.oauth
Classpublic class OAuth
InheritanceOAuth Inheritance flash.events.EventDispatcher
ImplementsIOAuth

OAuth Authentication Utility - requires the as3crypto library to work.



Public Properties
 PropertyDefined by
  callbackURL : String
NEW - Get/Set the OAuth Callback URL
OAuth
  consumerKey : String = ""
Get/Set the Consumer Key for your Application
OAuth
  consumerSecret : String = ""
Get/set the Consumer Secret for your Application
OAuth
  htmlLoader : HTMLLoader
NEW - AIR only! The HTMLLoader to be used to display the OAuth Authentication Process from Twitter in.
OAuth
  oauthToken : String = ""
Get/Set the User Token
OAuth
  oauthTokenSecret : String = ""
Get/Set the User Token Secret
OAuth
  pinlessAuth : Boolean = false
NEW - Whether to use pinless OAuth or not.
If you set this to true, you will have to supply a callback url via callbackURL
OAuth
  serviceHost : String
Service Host URL you want to use.
OAuth
  userId : String
[read-only] Get the twitter user_id (retrieval only available after successful user authorization)
OAuth
  username : String
Get/set the twitter screen_name (retrieval only available after successful user authorization)
OAuth
Public Methods
 MethodDefined by
  
Creates a new OAuth Instance
OAuth
  
Requests a OAuth Authorization Token and will build the proper authorization URL if successful.
OAuth
  
getSignedRequest(method:String, url:String, urlVars:URLVariables = null):String
Signs a Request and returns an proper encoded argument string.
There usually is no need to call this by yourself.

OAuth
  
requestAccessToken(verifier:String):void
Requests the final Access Token to finish the OAuth Authorization.
OAuth
  
toString():String
NEW - Returns username, userid, oauth token and secret in a practical string ;)
OAuth
Events
 EventSummaryDefined by
   Dispatched when the OAuth has succesfully completed a Request.OAuth
   Dispatched when something goes wrong while trying to authorize OAuth
Property detail
callbackURLproperty
callbackURL:String  [read-write]

NEW - Get/Set the OAuth Callback URL

Implementation
    public function get callbackURL():String
    public function set callbackURL(value:String):void
consumerKeyproperty 
public var consumerKey:String = ""

Get/Set the Consumer Key for your Application

consumerSecretproperty 
public var consumerSecret:String = ""

Get/set the Consumer Secret for your Application

htmlLoaderproperty 
public var htmlLoader:HTMLLoader

NEW - AIR only! The HTMLLoader to be used to display the OAuth Authentication Process from Twitter in.

oauthTokenproperty 
public var oauthToken:String = ""

Get/Set the User Token

oauthTokenSecretproperty 
public var oauthTokenSecret:String = ""

Get/Set the User Token Secret

pinlessAuthproperty 
public var pinlessAuth:Boolean = false

NEW - Whether to use pinless OAuth or not.
If you set this to true, you will have to supply a callback url via callbackURL

serviceHostproperty 
serviceHost:String  [read-write]

Service Host URL you want to use. This has to be changed if you are going to use tweetr from a web app. Since the crossdomain policy of twitter.com is very restrictive. use Tweetr's own PHPProxy Class for this.

Implementation
    public function get serviceHost():String
    public function set serviceHost(value:String):void
userIdproperty 
userId:String  [read-only]

Get the twitter user_id (retrieval only available after successful user authorization)

Implementation
    public function get userId():String
usernameproperty 
username:String  [read-write]

Get/set the twitter screen_name (retrieval only available after successful user authorization)

Implementation
    public function get username():String
    public function set username(value:String):void
Constructor detail
OAuth()constructor
public function OAuth()

Creates a new OAuth Instance

Method detail
getAuthorizationRequest()method
public function getAuthorizationRequest():void

Requests a OAuth Authorization Token and will build the proper authorization URL if successful. When the URL has been created a OAuthEvent.COMPLETE will be fired containing the url.

getSignedRequest()method 
public function getSignedRequest(method:String, url:String, urlVars:URLVariables = null):String

Signs a Request and returns an proper encoded argument string.
There usually is no need to call this by yourself.

Parameters
method:String — The URLRequest Method used. Valid values are POST and GET
 
url:String — The Request URL
 
urlVars:URLVariables (default = null) — URLVariables that need to be signed

Returns
String
requestAccessToken()method 
public function requestAccessToken(verifier:String):void

Requests the final Access Token to finish the OAuth Authorization. When the Request succeeds a OAuthEvent.COMPLETE will be fired and the OAuth Instance will contain all the information needed to successfully call any Twitter API Method.

Parameters
verifier:String — PIN or verifier_token given by Twitter on the Authorization Page.
toString()method 
public override function toString():String

NEW - Returns username, userid, oauth token and secret in a practical string ;)

Returns
String
Event detail
completeevent 
Event object type: com.swfjunkie.tweetr.oauth.OAuthEvent
OAuthEvent.type property = com.swfjunkie.tweetr.oauth.events.OAuthEvent.COMPLETE

Dispatched when the OAuth has succesfully completed a Request.

The event returns the following properties:

PropertyValue
urlReturns the Authorization URL when getAuthorizationRequest() was successful.
errorevent  
Event object type: com.swfjunkie.tweetr.oauth.OAuthEvent
OAuthEvent.type property = com.swfjunkie.tweetr.oauth.events.OAuthEvent.ERROR

Dispatched when something goes wrong while trying to authorize

The event returns the following properties:

PropertyValue
textContains an error message




comments powered by Disqus