Traditionally speaking authentication is a difficult task - we have to manage and maintain users, need to store their details while, during the login procedure we need to execute some code at the server-side. But with the Jamstack we no longer have servers and therefore we are not able to run code server-side. So the question is, how can we manage sessions and do authentication without a server? The aim of this course is to help you answer this question.
During this course we will build two separate applications to showcase how authentication can be applied in the Jamstack. Both applications use Next.js which is a React based static site generator.
In the first part of the course we take a look at Next.js and learn its basics which will allow us to build the two sample applications. Things such as routing, data processing and serverless (lambda) functions are covered.
The first app goes through the basics of token based authentication by building a REST API with a protected route, that can only be viewed if a valid token is provided. The token is received from Auth0, a service that we setup to utilise GitHub based authentication.
The second application introduces Strapi - an API based headless content management system - which gives us the power to manage not only our content but users as well, furthermore Strapi's authentication model also works with JSON Web Tokens which we will leverage. The course displays some additional capabilities of Strapi - including how to connect it with Auth0 and how to utilise it with GraphQL for the data found in the CMS without having to do any extra work.
In the last section of the course, we'll learn how to deploy our applications to Zeit Now (renamed to Vercel) - a deployment platform that works seamlessly with Next.js while also learning how to deploy APIs and Strapi to Heroku.
Tamas is a Google Developer Expert in Web Technologies and a Developer Evangelist. He has more than a decade of experience delivering technical training to large, prestigious organisations. Throughout his career, he has delivered presentations and training classes all over the world. His passionate about unlocking the latest & greatest features of web development.
StartIntroduction to JWT (JSON Web Tokens) (5:55)
StartAdding Authentication to a REST API (12:59)
StartAuthentication, APIs and Audience with Auth0 (7:19)
StartAdd authentication to Next.js - Part 1 (23:35)
StartAdd authentication to Next.js - Part 2 (12:37)
StartAdd authentication to Next.js - Part 3 (18:15)
Frequently Asked Questions
Get started with the Jamstack today! Becoming hands-on with technologies and services being heavily utilised by Jamstack projects will give you first-class experience of the stack. You will gain valuable knowledge and be able to apply your newly gathered skills in different projects.