Skip to content

Commit b136e35

Browse files
author
Kalyan Krishna
committed
Minor edits
1 parent d5271fa commit b136e35

File tree

3 files changed

+21
-15
lines changed

3 files changed

+21
-15
lines changed

2-Authorization-I/1-call-graph/AppCreationScripts/Configure.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ Function ConfigureApplications
254254

255255
# URL of the AAD application in the Azure portal
256256
# Future? $clientPortalUrl = "https://portal.azure.com/#@"+$tenantName+"/blade/Microsoft_AAD_RegisteredApps/ApplicationMenuBlade/Overview/appId/"+$currentAppId+"/objectId/"+$currentAppObjectId+"/isMSAApp/"
257-
$clientPortalUrl = "https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationMenuBlade/CallAnAPI/appId/"+$currentAppId+"/objectId/"+$currentAppObjectId+"/isMSAApp/"
257+
$clientPortalUrl = "https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationMenuBlade/~/Overview/appId/"+$currentAppId+"/isMSAApp~/false"
258258

259259
Add-Content -Value "<tr><td>client</td><td>$currentAppId</td><td><a href='$clientPortalUrl'>ms-identity-javascript-c2s1</a></td></tr>" -Path createdApps.html
260260
# Declare a list to hold RRA items

2-Authorization-I/1-call-graph/AppCreationScripts/sample.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
22
"Sample": {
3-
"Title": "Vanilla JavaScript single-page application using MSAL.js to authorize users for calling Microsoft Graph",
3+
"Title": "Vanilla JavaScript single-page application using MSAL.js to authenticate users to call Microsoft Graph",
44
"Level": 100,
55
"Client": "Vanilla JavaScript SPA",
6+
"Service": "Microsoft Graph",
67
"RepositoryUrl": "ms-identity-javascript-tutorial",
78
"Endpoint": "AAD v2.0",
89
"Languages": ["javascript"],
9-
"Description": "Vanilla JavaScript single-page application using MSAL.js to authorize users for calling Microsoft Graph",
10+
"Description": "Vanilla JavaScript single-page application using MSAL.js to authenticate users and calling the Microsoft Graph API on their behalf",
1011
"Products": ["azure-active-directory", "msal-js", "msal-browser"],
1112
"Platform": "JavaScript"
1213
},

2-Authorization-I/1-call-graph/README.md

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
page_type: sample
3-
name: Vanilla JavaScript single-page application using MSAL.js to authorize users for calling Microsoft Graph
4-
description: Vanilla JavaScript single-page application using MSAL.js to authorize users for calling Microsoft Graph
3+
name: Vanilla JavaScript single-page application using MSAL.js to authenticate users to call Microsoft Graph
4+
description: Vanilla JavaScript single-page application using MSAL.js to authenticate users and calling the Microsoft Graph API on their behalf
55
languages:
66
- javascript
77
products:
@@ -15,9 +15,10 @@ extensions:
1515
- endpoint: AAD v2.0
1616
- level: 100
1717
- client: Vanilla JavaScript SPA
18+
- service: Microsoft Graph
1819
---
1920

20-
# Vanilla JavaScript single-page application using MSAL.js to authorize users for calling Microsoft Graph
21+
# Vanilla JavaScript single-page application using MSAL.js to authenticate users to call Microsoft Graph
2122

2223
* [Overview](#overview)
2324
* [Scenario](#scenario)
@@ -33,10 +34,12 @@ extensions:
3334

3435
## Overview
3536

36-
This sample demonstrates a Vanilla JavaScript single-page application that lets users authenticate against [Azure Active Directory](https://docs.microsoft.com/azure/active-directory/fundamentals/active-directory-whatis) (Azure AD) using the [Microsoft Authentication Library for JavaScript](https://github.com/AzureAD/microsoft-authentication-library-for-js) (MSAL.js), then acquires an **Access Token** for Microsoft Graph and calls the [Microsoft Graph API](https://docs.microsoft.com/graph/overview). In doing so, it also illustrates various authorization concepts, such as [Access Tokens](https://docs.microsoft.com/azure/active-directory/develop/access-tokens), [Authorization Code Grant](https://docs.microsoft.com/azure/active-directory/develop/v2-oauth2-auth-code-flow), [Dynamic Scopes and Incremental Consent](https://docs.microsoft.com/azure/active-directory/develop/v2-permissions-and-consent), **silent requests** and more.
37+
This sample demonstrates a Vanilla JavaScript single-page application that lets users authenticate against [Azure Active Directory](https://docs.microsoft.com/azure/active-directory/fundamentals/active-directory-whatis) (Azure AD) using the [Microsoft Authentication Library for JavaScript](https://github.com/AzureAD/microsoft-authentication-library-for-js) (MSAL.js), then acquires an **[Access Token](https://aka.ms/access-tokens)** for Microsoft Graph and calls the [Microsoft Graph API](https://docs.microsoft.com/graph/overview). In doing so, it also illustrates various authorization concepts, such as [Access Tokens](https://docs.microsoft.com/azure/active-directory/develop/access-tokens), [Authorization Code Grant](https://docs.microsoft.com/azure/active-directory/develop/v2-oauth2-auth-code-flow), [Dynamic Scopes and Incremental Consent](https://docs.microsoft.com/azure/active-directory/develop/v2-permissions-and-consent), **silent requests** and more.
3738

3839
In addition, this sample also demonstrates how to use the [Microsoft Graph JavaScript SDK](https://github.com/microsoftgraph/msgraph-sdk-javascript) client with MSAL as a custom authentication provider to query the Graph API. Note that you are not required to implement a custom provider, as the v3.0 (preview) of the SDK offers a [default provider](https://github.com/microsoftgraph/msgraph-sdk-javascript/blob/dev/docs/AuthCodeMSALBrowserAuthenticationProvider.md) that implements MSAL.js.
3940

41+
> :information_source: To learn how applications integrate with [Microsoft Graph](https://aka.ms/graph), consider going through the recorded session:: [An introduction to Microsoft Graph for developers](https://www.youtube.com/watch?v=EBbnpFdB92A)
42+
4043
## Scenario
4144

4245
1. The client application uses the **MSAL.js** to sign-in a user and obtain a JWT **Access Token** from **Azure AD**:
@@ -93,12 +96,12 @@ or download and extract the repository *.zip* file.
9396

9497
There is one project in this sample. To register it, you can:
9598

96-
* follow the steps below for manually register your apps
97-
* or use PowerShell scripts that:
98-
* **automatically** creates the Azure AD applications and related objects (passwords, permissions, dependencies) for you.
99-
* modify the projects' configuration files.
99+
- follow the steps below for manually register your apps
100+
- or use PowerShell scripts that:
101+
- **automatically** creates the Azure AD applications and related objects (passwords, permissions, dependencies) for you.
102+
- modify the projects' configuration files.
100103

101-
<details>
104+
<details>
102105
<summary>Expand this section if you want to use this automation:</summary>
103106

104107
> :warning: If you have never used **Microsoft Graph PowerShell** before, we recommend you go through the [App Creation Scripts Guide](./AppCreationScripts/AppCreationScripts.md) once to ensure that your environment is prepared correctly for this step.
@@ -120,7 +123,7 @@ There is one project in this sample. To register it, you can:
120123

121124
> Other ways of running the scripts are described in [App Creation Scripts guide](./AppCreationScripts/AppCreationScripts.md). The scripts also provide a guide to automated application registration, configuration and removal which can help in your CI/CD scenarios.
122125

123-
</details>
126+
</details>
124127

125128
#### Choose the Azure AD tenant where you want to create your applications
126129

@@ -149,7 +152,8 @@ To manually register the apps, as a first step you'll need to:
149152
1. Select the **Add a permission** button and then:
150153
1. Ensure that the **Microsoft APIs** tab is selected.
151154
1. In the *Commonly used Microsoft APIs* section, select **Microsoft Graph**
152-
1. In the **Delegated permissions** section, select **User.Read**, **Contacts.Read** in the list. Use the search box if necessary.
155+
* Since this app signs-in users, we will now proceed to select **delegated permissions**, which is requested by apps that signs-in users.
156+
* In the **Delegated permissions** section, select **User.Read**, **Contacts.Read** in the list. Use the search box if necessary.
153157
1. Select the **Add permissions** button at the bottom.
154158

155159
##### Configure Optional Claims
@@ -201,6 +205,7 @@ Were we successful in addressing your learning objective? Consider taking a mome
201205
Use [Stack Overflow](http://stackoverflow.com/questions/tagged/msal) to get support from the community. Ask your questions on Stack Overflow first and browse existing issues to see if someone has asked your question before.
202206
Make sure that your questions or comments are tagged with [`azure-active-directory` `msal-js` `ms-identity` `adal` `msal`].
203207

208+
To provide feedback on or suggest features for Azure Active Directory, visit [User Voice page](https://feedback.azure.com/d365community/forum/79b1327d-d925-ec11-b6e6-000d3a4f06a4).
204209
</details>
205210

206211
## About the code
@@ -277,7 +282,7 @@ The **MSAL.js** exposes the `acquireTokenSilent()` API which is meant to retriev
277282

278283
### Access Token validation
279284

280-
Clients should treat access tokens as opaque strings, as the contents of the token are intended for the **resource only** (such as a web API or Microsoft Graph). For validation and debugging purposes, developers can decode **JWT**s (*JSON Web Tokens*) using a site like [jwt.ms](https://jwt.ms).
285+
Clients should treat access tokens as opaque strings, as the contents of the token are intended for the **resource only** (such as a web API or Microsoft Graph). For validation and debugging purposes, developers can decode **JWT**s (*JSON Web Tokens*) using a site like [jwt.ms](https://jwt.ms). This sample does not need to validate Access Tokens it acquires.
281286

282287
### Calling the Microsoft Graph API
283288

0 commit comments

Comments
 (0)