Releases: matt-wigg/next-14-azure-auth
v1.0.6
What's Changed
- chore(deps-dev): bump tailwindcss from 3.4.14 to 3.4.17 by @dependabot in #90
- chore(deps-dev): bump postcss from 8.4.47 to 8.4.49 by @dependabot in #94
- chore(deps-dev): bump eslint-config-next from 14.2.15 to 15.1.3 by @dependabot in #92
- chore(deps-dev): bump typescript from 5.6.3 to 5.7.2 by @dependabot in #91
Full Changelog: v1.0.5...v1.0.6
v1.0.5
Full Changelog: v1.0.4...v1.0.5
v1.0.4
Full Changelog: v1.0.3...v1.0.4
v1.0.3
Full Changelog: v1.0.2...v1.1.0
v1.0.2
What's Changed
- chore(deps): bump next from 14.2.15 to 14.2.22 in the npm_and_yarn group by @dependabot in #89
Full Changelog: v1.0.1...v1.0.2
v1.0.1
What's Changed
- remove duplicate figure container by @matt-wigg in #88
Full Changelog: v1.0.0...v1.0.1
v1.0.0
Next-14-Azure-Auth
Next-14-Azure-Auth is a starter template for building secure Next.js v14+ apps with Microsoft Entra ID authentication and a Microsoft Graph API integration. It uses the NextAuth.js library for authentication and Microsoft Graph for fetching user data.
Prerequisites
Ensure the following are installed before running the application locally:
Azure Setup for Microsoft Entra ID
-
Register the Application
-
Navigate to the Azure portal.
-
Go to Microsoft Entra ID > App registrations > New registration.
-
Name your application (e.g.,
Next-14-Azure-Auth
). -
Choose "Accounts in this organizational directory only" for Supported account types.
-
Set the Redirect URI to
http://localhost:3000/api/auth/callback/microsoft-entra-id
and click Register.
-
-
Configure the Application
-
On the app's overview page, copy the Application (client) ID and Directory (tenant) ID—you’ll need these in your
.env.local
file. -
Go to Certificates & secrets > Client secrets > New client secret.
-
Add a description (e.g.,
Next-14-Azure-Auth Secret
), set the expiration, and copy the generated secret value to your.env.local
file.
-
-
Set Up API Permissions
-
Navigate to API permissions > Add a permission.
-
Select Microsoft Graph and add these permissions:
User.Read
openid
email
profile
-
Click Grant admin consent to apply these permissions.
-
-
(Optional) Create an Enterprise Application
-
To assign users/groups to the application:
-
Go to Azure Active Directory > Enterprise applications.
-
Find your application by name.
-
Under Users and groups, assign the relevant users/groups.
-
Installation
-
Clone the Repository
git clone https://github.com/matt-wigg/next-14-azure-auth.git cd next-14-azure-auth
-
Install Dependencies
npm install
Or, if using yarn:
yarn install
-
Set Up Environment Variables
Create a
.env.local
file in the root of your project and add the following variables:AUTH_SECRET=your_auth_secret AUTH_MICROSOFT_ENTRA_ID_ID=your_azure_client_id AUTH_MICROSOFT_ENTRA_ID_SECRET=your_azure_client_secret AUTH_MICROSOFT_ENTRA_ID_ISSUER=your_azure_issuer_id
-
Generate the AUTH_SECRET
To generate the
AUTH_SECRET
, run the following command:openssl rand -base64 32
-
Run the Application
Start the development server:
npm run dev
Or, with yarn:
yarn dev
Your application will run at
http://localhost:3000
.