O'Reilly logo

Programming Google Glass by Eric Redmond

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Applying OAuth to Create Glassware

We’ll expand our Lunch Roulette application from the previous chapter to include authentication. This is a required step for activating a Glass application.

The crux of our authorization process is threefold:

  1. Filter all incoming requests and redirect a request to be authorized if no user is in session or no credentials are stored.

  2. Provide an OAuth 2.0 endpoint servlet. This does the real heavy lifting. It can act as either the redirect to the Google authorization server or the callback accepting and storing Google Accounts’ responding auth code. It is also responsible for requesting the initial access token with the given authorization grant (a ‘code‘ parameter).

  3. Provide a logout servlet to remove stored ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required