This developer sample is used to run basic use cases for the MSAL library. You can also alter the configuration in ./app/<sample-name>/authConfig.js
to execute other behaviors.
- Ensure all pre-requisites have been completed to run msal-browser.
- Install node.js if needed (https://nodejs.org/en/).
- Build the
msal-browser
project with instructions provided in theREADME.md
or using the commandnpm run build:package
.
- Open
./app/<sample-name>/authConfig.js
in an editor. - Replace client id with the Application (client) ID from the portal registration, or use the currently configured lab registration.
- Optionally, you may replace any of the other parameters, or you can remove them and use the default values.
- In a command prompt, run
npm install
.
-
In a command prompt, run
npm start
.- If you wish to specify a different sample than the default, you may provide the sample name in the command prompt:
npm start -- -sample <sample-name> // defaults to vanilla sample in `default` folder
npm start -- -s <sample-name> // defaults to vanilla sample in 'default' folder
- If you wish to specify the port, you can provide the
-p
or-port
flag:
npm start -- -port <port-#> // defaults to 30662
npm start -- -p <port-#> // defaults to 30662
-
Navigate to http://localhost:30662 (or whatever port number specified) with the browser of your choice.
-
In the web page, click on the "Sign In" button and select either
Sign in using Popup
orSign in using Redirect
to begin the auth flow.