This developer sample is used to run basic use cases for the MSAL library. You can also alter the configuration in ./app/default/authConfig.js to execute other behaviors.
This is a modified version of the 'default' sample included in the msal-browser library, with additional scripts to demonstrate how to decode MSAL hashed logs live in the browser.
The included client ID is the same provided in the original Microsoft sample.
- Ensure all pre-requisites have been completed to run msal-browser.
- Install node.js if needed (https://nodejs.org/en/).
- Build the
msal-browserproject with instructions provided in theREADME.mdor using the commandnpm run build:package.
- Open
./app/default/authConfig.jsin 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 at the root of the repository, run
npm install.Next run
npm run copy:msal-mappingsto copy MSAL mapping files to the sample's default directory. This is required for MSAL logging to be decoded.In a command prompt, run
npm start.Open a browser window and open the developer console to view logs.
Navigate to http://localhost:30662 (or whatever port number specified) in the window with the console open. MSAL logs will be decoded with the copied mapping files, and will include additional information such as log level and timestamp.
In the web page, click on the "Sign In" button and select either
Sign in using PopuporSign in using Redirectto begin the auth flow.