Skip to content

BenjaminWFox/nextjs-azureb2c-nextauth

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Next.js / Azure B2C / NextAuth.js

This is an example repo showing how to configure authentication via Azure B2C in Next.js

The main branch has the complete code. You can also take a look at this pull request to see the code diff required to create basic working authentication. As a followup, take a look at this pull request which has examples for two options of signing out, depending on your needs.

Local setup

You should be able to run this locally if you have already set up everything in azure. You will need to rename .env.example to .env and update the values to match your Azure B2C Tenant, User Flow, and App Registration values.

Getting Started

This is a Next.js project bootstrapped with create-next-app.

First, run the development server:

npm run dev
# or
yarn dev

Open http://localhost:3000 with your browser to see the result.

You can start editing the page by modifying pages/index.js. The page auto-updates as you edit the file.

About

Demo app showing Azure B2C Authentication in Next.js with NextAuth.js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published