https://github.com/benjaminwfox/nextjs-azureb2c-nextauth
Demo app showing Azure B2C Authentication in Next.js with NextAuth.js
https://github.com/benjaminwfox/nextjs-azureb2c-nextauth
Last synced: over 1 year ago
JSON representation
Demo app showing Azure B2C Authentication in Next.js with NextAuth.js
- Host: GitHub
- URL: https://github.com/benjaminwfox/nextjs-azureb2c-nextauth
- Owner: BenjaminWFox
- Created: 2020-08-25T01:27:20.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2020-08-25T14:34:12.000Z (almost 6 years ago)
- Last Synced: 2025-03-26T02:42:37.343Z (over 1 year ago)
- Language: JavaScript
- Size: 157 KB
- Stars: 11
- Watchers: 1
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## 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](https://github.com/BenjaminWFox/nextjs-azureb2c-nextauth/pull/1/files) to see the code diff required to create basic working authentication. As a followup, take a look at [this pull request](https://github.com/BenjaminWFox/nextjs-azureb2c-nextauth/pull/3/files) 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](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
First, run the development server:
```bash
npm run dev
# or
yarn dev
```
Open [http://localhost:3000](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.