This project was generated with Angular CLI version 10.2.0. The objective of this project is to demonstrate authenticating Angular apps with Azure Active Directory using MSAL Angular 1.0.
Microsoft released Version 1.0 of its Library for Angular that facilitates the implementation of OAuth 2.0 token based authentication into Azure Active Directory. The library was released on May 3rd 2020 ending a long phase of workarounds and beta versions of the Angular variant of the MSAL library for Single Page Applications (SPA).
- NPM, Angular CLI (v10)
- Azure AD, get your free Azure account here: https://azure.microsoft.com/en-us/free/
Run ng serve
for a dev server. Navigate to http://localhost:4200/
. The app will automatically reload if you change any of the source files.
Run ng generate component component-name
to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module
.
Run ng build
to build the project. The build artifacts will be stored in the dist/
directory. Use the --prod
flag for a production build.
Replace the following in the environment.ts config with your application specific values:
- clientId: '{YOUR-APP-CLIENT_ID}',
- authority: 'https://login.microsoftonline.com/{YOUR-APP-TENANT-ID}/'