concept user in category scalatra

appears as: user, User, users, The user
Scalatra in Action

This is an excerpt from Manning's book Scalatra in Action.

GET is the most familiar of the HTTP methods. When a user enters an address in the browser’s location bar, a GET request is submitted. Simple hyperlinks generate a GET request. The class in the following listing creates a route that fetches information about an artist by name.

Figure 6.1. User interface for the document store example

It’s worth understanding right at the start that typically there are big differences between web applications and HTTP APIs when it comes to authentication. Web applications usually require a user to log in once, and then they hold on to that authentication state across multiple requests: they are stateful. APIs usually require that each request is authenticated independently of all other requests: they are stateless.

The anatomy of any Scentry strategy is fairly simple. Strategies are just regular Scala classes that inherit from ScentryStrategy. They must implement two methods: a way to retrieve a user for authentication purposes, and a way to authenticate that the user is who they say they are.