In my last post, “Introduction to Web Apps with Next.js”, we went through the steps of setting up a new Next.js project, customizing a landing page, and implementing a very simple web application. In this post, we’ll implement an Open Authentication (OAuth) based Single Sign-On (SSO) API within Next.js using NextAuth.js. We’ll be using GitHub as our provider, but the steps here are very similar for other platforms, such as Google or Discord. This will allow us to place portions of our website behind a login screen, restricting access to certain content or APIs for anonymous visitors.