This guide explains how to set up authentication using Microsoft Authentication Library (MSAL) in a Nuxt 3 project.
- Node.js installed on your machine
- A Microsoft Azure account
- Basic understanding of Nuxt.js
- Install Nuxt 3 and create a new project.
- Install MSAL using npm or yarn:
npm install @azure/msal-browser
or
yarn add @azure/msal-browser
Define your MSAL configuration in a plugins/msal.js
file.
- Create an authentication service to encapsulate MSAL functionality.
- Use the authentication service in your Nuxt 3 application where authentication is required.
# install dependencies
npm install
# serve with hot reload
npm run dev
You can see the demo here : MSAL Nuxt3