page_type | languages | products | description | urlFragment | |||
---|---|---|---|---|---|---|---|
sample |
|
|
A simple Angular single page application calling the Microsoft Graph using MSAL Angular (Azure AD V2 endpoint). |
active-directory-javascript-singlepageapp-angular |
A simple Angular single-page application which demonstrates how to configure MSAL Angular to login, logout, protect a route, and acquire an access token for a protected resource such as the Microsoft Graph.
Note: This sample's structure was generated with the Angular CLI.
File/folder | Description |
---|---|
e2e |
End-to-end test files. |
src |
Sample source code. |
.editorconfig |
Defines editor config settings. |
.gitignore |
Define what to ignore at commit time. |
angular.json |
Angular configuration file. |
browserslist |
BrowsersList configuration file. |
CHANGELOG.md |
List of changes to the sample. |
CODE_OF_CONDUCT.md |
Code of Conduct information. |
CONTRIBUTING.md |
Guidelines for contributing to the sample. |
karma.conf.js |
Configuration for the karma test runner. |
LICENSE |
The license for the sample. |
NG_README.md |
README auto-generated by the Angular CLI. |
package-lock.json |
Lockfile for npm. |
package.json |
Package manifest for npm. |
README.md |
This README file. |
SECURITY.md |
Security disclosures. |
tsconfig.*.json |
TypeScript configuration files. |
tslint.json |
TS Lint configuration files. |
Node must be installed to run this sample.
- Register a new application in the Azure Portal. Ensure that the application is enabled for the implicit flow.
- Open the src/app/app.module.ts file and provide the required configuration values (inside
MsalModule.forRoot
). - On the command line, navigate to the root of the repository, and run
npm install
to install the project dependencies via npm.
- To start the sample application, run
npm start
. - Next, open a browser to http://localhost:4200.
This sample demonstrates the following MSAL Angular concepts:
- Configuration
- Login
- Logout
- Protecting a route
- Acquiring an access token and attaching it to http calls
If you'd like to contribute to this sample, see CONTRIBUTING.MD.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.