This developer sample is used to demonstrate how to use @azure/msal-angular
with Angular standalone components, and does not use the MsalModule
or NgModule
.
Please see Angular's docs on standalone for more information.
This project was generated with Angular CLI version 15.1.4 and then upgraded to version 16.1.4.
- Ensure all pre-requisites have been completed to run msal-angular.
- Open
./src/main.ts
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 start
. - Navigate to http://localhost:4200
- In the web page, click on the "Login" button. The app will automatically reload if you change any of the source files.
- This sample does not use the
MsalRedirectComponent
, but subscribes tohandleRedirectObservable
in theapp.component.ts
file. See our doc on redirects for more information. - The default interaction type for the sample is redirects. The sample can be configured to use redirects by changing the
interactionType
inmain.ts
toInteractionType.Popup
.