Book Image

Lift Application Development Cookbook

By : Gilberto Tadeu Garcia Jun
Book Image

Lift Application Development Cookbook

By: Gilberto Tadeu Garcia Jun

Overview of this book

Developing secure web applications is one of the most important tasks developers have to deal with. With Lift, it is easy to create solid and formidable web applications as it is the most secure web framework available today. The View-First approach and being able to handle things as purely data transformation, makes working with Lift an exciting task. "Lift Application Development Cookbook" teaches you how to build web applications using this amazing framework. The book moves gradually, starting with the basics (starting a new project, submitting a form, and so on) before covering more advanced topics such as building a REST API and integrating your application with other technologies and applications. "Lift Application Development Cookbook" takes you on a journey of creating secure web applications. Step-by-step instructions help you understand how things work and how various elements relate to each other. You'll learn different ways to process a form, build dynamic HTML pages, and create an API using REST. You'll also learn how to work with relational and NoSQL databases and how to integrate your application with other technologies as well as with third-part applications such as Gmail and Facebook. By the end of the book, you will be able to understand how Lift works and be able to build web applications using this amazing and exciting framework.
Table of Contents (15 chapters)
Lift Application Development Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Signing up using a Twitter account


We will now learn how to log users in to your application using their Twitter account. Unlike Gmail, Facebook, and LinkedIn, Twitter does not have an OAuth2 API where you can make requests on behalf of the user. This means that we can only use OAuth2 to communicate with a small part of their API.

Unfortunately, the API part involved in the process of verifying user credentials is only accessible via Twitter's OAuth API, which uses Version 1 of the OAuth protocol. I said unfortunately because more work—code, requests, and more—is necessary when working with OAuth. However, there is a neat library we can use to work with OAuth that will make our lives easier.

Getting ready

  1. Start a new blank project.

  2. Edit the build.sbt file by adding the following dependency:

    "org.scribe" % "scribe" % "1.3.5" % "compile"
  3. Create a new app on Twitter and add its id and secret keys in the default.props file:

    twitter.consumer.key=<app-key>
    twitter.consumer.secret=<app-secret...