Skip to Content
Introduction to Tornado
book

Introduction to Tornado

by Michael Dory, Allison Parrish, Brendan Berg
March 2012
Beginner to intermediate
138 pages
3h 21m
English
O'Reilly Media, Inc.
Content preview from Introduction to Tornado

Example: Facebook Authentication and the Graph API

The Facebook example is structurally very similar to the Twitter example we just saw. Facebook has two different API standards, the original REST API and the Facebook Graph API. While both are currently supported, the Graph API is the recommended way to develop new Facebook applications. Tornado supports both APIs in the auth module, but we will focus on the Graph API in this example.

In order to prepare for this example, you will need to sign in to Facebook’s developer site and create a new application. You will be asked to name your application and asked to prove you are not a robot. In order to authorize users from your own domain, you will need to specify your application’s domain name. Then click the “Website” box under the “Select how your app integrates with Facebook” heading. You will need to enter your site’s URL here as well. For a more complete guide to setting up a Facebook app, the developer guides are a good start: https://developers.facebook.com/docs/guides/web/.

Once your application is set up, you will use the application ID and secret provided in the Basic Settings page to connect to the Facebook Graph API.

Recall from the previous section that the single sign-on workflow will direct a user to the Facebook platform to authorize the application, and Facebook will use an HTTP redirect to send the user back to your server with an authorization code. Once you receive the request with the code, you must request the authorization ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Dart: Scalable Application Development

Dart: Scalable Application Development

Davy Mitchell, Sergey Akopkokhyants, Ivo Balbaert
Your First Week With Node.js, 2nd Edition

Your First Week With Node.js, 2nd Edition

James Hibbard, Craig Buckler, Mark Brown, Nilson Jacques, James Kolce, Paul Orac, M. David Green, Florian Rappl

Publisher Resources

ISBN: 9781449312787Errata Page