Skip to content

Latest commit

 

History

History
74 lines (45 loc) · 2.6 KB

README.md

File metadata and controls

74 lines (45 loc) · 2.6 KB

Next.js with NextAuth.js and Azure AD B2C Example

This repository provides a practical example of integrating Next.js version 14, NextAuth.js version 5 (beta version, soon to be Auth.js), and Azure AD B2C for Single Page Applications with Signin User Flow.

The implementation of Login, Logout, and Refresh Token Rotation features is designed to help other developers get a quick start.

For the NextAuth.js Upgrade Guide (v5) click here.

Getting Started

Configure Azure AD B2C

Follow the instructions to obtain the necessary credentials:

Setup and Run

  1. Clone this repository:
git clone https://github.com/karoldavid/next-auth-azure-ad-b2c-example.git
  1. Install dependencies:
cd next-auth-azure-ad-b2c-example
yarn
  1. Configure your Azure AD B2C settings:

Update the .env.local.example file with your B2C configuration and rename it to .env.local.

  1. Run the application:
npm run dev
  1. Visit http://localhost:3000 in your browser.

Implemented Features

Login

Logout

Refresh Token Rotation

Resources

The following resources were helpful in implementing these features:

License

This project is licensed under the terms of the MIT license. For more details, see the LICENSE file in the repository.