Chapter 11. Authentication

This chapter covers

  • Stateful vs. stateless authentication
  • The Scentry authentication framework
  • HTTP Basic authentication
  • Session handling in Scalatra
  • Form-based login with a username and password
  • Remembering a user with a cookie
  • Defining multiple authentication strategies for a single application

Authentication, the act of confirming that somebody is who you think they are, is something you’ll do over and over when constructing HTTP applications. To illustrate how authentication works in Scalatra, you’ll protect parts of the Hacker Tracker application from chapter 4. You’ll change it so that only logged-in users can add, remove, or edit hackers.

It’s worth understanding right at the start that typically ...

Get Scalatra in Action 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.