Time for action – authenticating via JavaScript

Here's what is going to happen:

  1. We'll embed our application's SWF in a web page, and load the page in a browser.
  2. The application will call a JavaScript function inside the web page, telling it to load the "authorize" URL in a new browser window.
  3. The new window may ask us to log in; once we're authenticated, it'll redirect to the Redirect URI page, just as when we used it earlier.
  4. This time, however, we'll have changed the Redirect URI page to one that we control (rather than using the Google home page). It will obtain the access token and pass it back to a JavaScript function in the page containing our application's SWF.
  5. That JavaScript function will pass the access token to an AS3 function in our application, ...

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

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.