In Swift web frameworks, there are two authentication approaches: web-based and API-based. For the web-based authentication, a framework takes advantage of web browser's session ability to persist the authenticated access. For API-based authentication, the client to a Swift web framework may not be a web browser. In that case, a token is generated to persist authenticated access for a user. In this chapter, you'll focus on securing your web resources with web-based authentication.
Introducing the authentication API for Vapor
Using web authentication
A Swift web framework uses a web browser's sessions to persist state across multiple HTTP requests. A session is temporary because your session cookie may be deleted...