services | platforms | author |
---|---|---|
active-directory |
javascript |
jmprieur |
This sample demonstrates how to use the Microsoft Graph, while being authenticated with msal.js (doing oAuth 2.0 against the AAD v2.0 endpoint)
-
Register your Azure AD v2.0 app.
- Navigate to the App Registration Portal.
- Go to the the
My Apps
page, clickAdd an App
, and name your app. - Set a platform by clicking
Add Platform
, selectWeb
, and add a Redirect URI ofhttp://localhost:8000/
.
-
Clone the code.
git clone https://github.com/jmprieur/v2jsapp.git
-
Inside index.html, set your application/client id from the App Registration Portal.
-
Run the web app for port 8000, and navigate to http://localhost:8000. If you have Python installed you can run the following command,
python -m SimpleHTTPServer 8000
Please file any questions or problems with the sample as a github issue. You can also post on StackOverflow with the tag azure-active-directory
. For oAuth2.0 library issues, please see note above.
This sample was tested with hello.js v1.13.5, Google Chrome version 55.0, and macOS 10.11.
This sample was adapted from the hello.js sample: https://github.com/Azure-Samples/active-directory-javascript-graphapi-web-v2