Implementing authentication

Authentication is the process where we validate the identity of a given user and check whether the user has valid credentials to access our application or backend API. With authentication, we restrict the access to users who are not members of our application.

We will create a basic authentication API as the goal of this book is to show you how you can secure your Aurelia application. We won't go into further details about the backend implementation. We will create a hard-coded authentication flow, but you can integrate it with a database using Mongoose, as described in Chapter 6, Storing Our Data in MongoDB.

So, let's get our hands dirty. Open the backend project, create a new file in the routes folder called ...

Get Hands-On Full Stack Web Development with Aurelia 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.