Time for action – authenticating through the application

When authenticating in the browser, we visit https://graph.facebook.com/oauth/authorize?client_id=«your_application_id»&redirect_uri=http://google.com&type=user_agent, so let's start by loading that URL in our code.

Start by creating a new function, attemptToAuthenticate(), in HTTPRequestor.as:

public function attemptToAuthenticate():void { var loader:URLLoader = new URLLoader(); var urlRequest:URLRequest = new URLRequest(); var variables:URLVariables = new URLVariables(); urlRequest.url = "https://graph.facebook.com/oauth/authorize"; variables.client_id = "«your_application_id»"; variables.type = "user_agent"; variables.redirect_uri = "http://google.com"; urlRequest.data = variables; loader.addEventListener(Event.COMPLETE, ...

Get Facebook Graph API Development with Flash now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.