| Package | com.yahoo.social |
| Class | public class YahooSession |
| Inheritance | YahooSession flash.events.EventDispatcher |
// create a yahoo session object and pass
//into it the oauth credentials, appid and a guid
var session:YahooSession = new YahooSession('consumerKey', 'consumerSecret', 'appid');
See also
| Property | Defined by | ||
|---|---|---|---|
| application : ApplicationRequest
[read-only]
The instance of the ApplicationRequest API for this session.
| YahooSession | ||
| auth : AuthorizationRequest
[read-only]
The instance of the AuthorizationRequest request object for the consumer of this session.
| YahooSession | ||
| ownerGuid : String
The guid of the owning user.
| YahooSession | ||
| sessionStore : IYahooSessionStore
The implementation of IYahooSessionStore attached to this session.
| YahooSession | ||
| viewerGuid : String
The guid of the viewing user.
| YahooSession | ||
| yql : YQL
[read-only]
The instance of the YQL API for this session.
| YahooSession | ||
| Method | Defined by | ||
|---|---|---|---|
|
YahooSession(consumerKey:String, consumerSecret:String, applicationId:String, sessionStore:IYahooSessionStore = null)
Creates a new YahooSession object.
| YahooSession | ||
|
clearSession():void
Clears the session access token and removes all tokens from the session store.
| YahooSession | ||
|
The OAuthToken object for this session.
| YahooSession | ||
|
The OAuthConsumer object for this application.
| YahooSession | ||
|
Returns a YahooUser object representing the profile owner defined by
YahooSession.YAP_OWNER or the OAuth access token. | YahooSession | ||
|
Returns a YahooUser object representing the currently sessioned user (the viewer of the application)
defined by
YahooSession.YAP_VIEWER or the OAuth access token. | YahooSession | ||
|
Gets the user indicated by the GUID given.
| YahooSession | ||
|
openMessageDialog(to_guids:Array = null, subject:String = null, body:String = null, image:String = null):void
Directs the container to open the yml:message dialog.
| YahooSession | ||
|
openShareDialog(to_guids:Array = null, subject:String = null, body:String = null, image:String = null):void
Directs the container to open the yml:share dialog.
| YahooSession | ||
|
saveSession():void
Saves the session's request and access token to the token store.
| YahooSession | ||
|
sessionFromYAP(consumerKey:String, consumerSecret:String, applicationId:String, accessTokenKey:String, accessTokenSecret:String, viewerGUID:String):YahooSession
[static]
| YahooSession | ||
|
setAccessToken(token:OAuthToken):Boolean
Sets the session access token object.
| YahooSession | ||
| application | property |
application:ApplicationRequest [read-only]The instance of the ApplicationRequest API for this session.
Implementation public function get application():ApplicationRequest
| auth | property |
auth:AuthorizationRequest [read-only]The instance of the AuthorizationRequest request object for the consumer of this session.
Implementation public function get auth():AuthorizationRequest
| ownerGuid | property |
public var ownerGuid:StringThe guid of the owning user.
| sessionStore | property |
sessionStore:IYahooSessionStore [read-write]The implementation of IYahooSessionStore attached to this session.
The default value is YahooSessionStore.
public function get sessionStore():IYahooSessionStore
public function set sessionStore(value:IYahooSessionStore):void
See also
| viewerGuid | property |
public var viewerGuid:StringThe guid of the viewing user.
| yql | property |
yql:YQL [read-only]The instance of the YQL API for this session.
Implementation public function get yql():YQL
| YahooSession | () | constructor |
public function YahooSession(consumerKey:String, consumerSecret:String, applicationId:String, sessionStore:IYahooSessionStore = null)Creates a new YahooSession object.
ParametersconsumerKey:String — A String containing the OAuth consumer key. (API Key)
|
|
consumerSecret:String — A String containing the OAuth consumer secret.
|
|
applicationId:String — A String containing the application ID to identify this session.
|
|
sessionStore:IYahooSessionStore (default = null) — An optional implementation of IYahooSessionStore used to cache OAuth tokens.
Note: An access token key/secret must be obtained by a server-side component or via the
auth property of YahooSession.
|
| clearSession | () | method |
public function clearSession():voidClears the session access token and removes all tokens from the session store.
| getAccessToken | () | method |
public function getAccessToken():OAuthTokenThe OAuthToken object for this session.
ReturnsOAuthToken |
See also
| getConsumer | () | method |
public function getConsumer():OAuthConsumerThe OAuthConsumer object for this application.
ReturnsOAuthConsumer |
See also
| getOwner | () | method |
public function getOwner():YahooUser
Returns a YahooUser object representing the profile owner defined by
YahooSession.YAP_OWNER or the OAuth access token.
Only valid when a owner GUID is supplied by YAP, otherwise will
default to the logged-in user.
YahooUser |
See also
| getSessionedUser | () | method |
public function getSessionedUser():YahooUser
Returns a YahooUser object representing the currently sessioned user (the viewer of the application)
defined by YahooSession.YAP_VIEWER or the OAuth access token.
YahooUser |
See also
| getUser | () | method |
public function getUser(guid:String):YahooUserGets the user indicated by the GUID given.
Parametersguid:String — The GUID of the user to get.
|
YahooUser —
YahooUser The user indicated by the GUID given.
|
See also
| openMessageDialog | () | method |
public function openMessageDialog(to_guids:Array = null, subject:String = null, body:String = null, image:String = null):voidDirects the container to open the yml:message dialog. Only valid in applications within YAP.
Parametersto_guids:Array (default = null) — An array of GUIDs in which this message should be addressed to.
|
|
subject:String (default = null) — The message subject.
|
|
body:String (default = null) — The message body.
|
|
image:String (default = null) — A URL to an image to show in the dialog.
|
| openShareDialog | () | method |
public function openShareDialog(to_guids:Array = null, subject:String = null, body:String = null, image:String = null):voidDirects the container to open the yml:share dialog. Only valid in applications within YAP.
Parametersto_guids:Array (default = null) — An array of GUIDs in which this message should be addressed to.
|
|
subject:String (default = null) — The message subject.
|
|
body:String (default = null) — The message body.
|
|
image:String (default = null) — A URL to an image to show in the dialog.
|
| saveSession | () | method |
public function saveSession():voidSaves the session's request and access token to the token store.
| sessionFromYAP | () | method |
public static function sessionFromYAP(consumerKey:String, consumerSecret:String, applicationId:String, accessTokenKey:String, accessTokenSecret:String, viewerGUID:String):YahooSessionParameters
consumerKey:String |
|
consumerSecret:String |
|
applicationId:String |
|
accessTokenKey:String |
|
accessTokenSecret:String |
|
viewerGUID:String |
YahooSession |
| setAccessToken | () | method |
public function setAccessToken(token:OAuthToken):Boolean
Sets the session access token object.
If the token contains a GUID, this function will over-ride the YahooSession.YAP_VIEWER value
with the guid defined by the token.
The function will also check if the token expiration time has approached. If it is expired it will return false. At this point you should request a new access token.
If the consumer key does not match the consumer key found in the access token it will return false and not set the session.
Parameterstoken:OAuthToken — An OAuthToken object containing the access token and secret.
|
Boolean — A Boolean True if the token is valid.
|