Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Commit a5eb138

Browse files
committed
ch2 review changes
1 parent e202890 commit a5eb138

File tree

8 files changed

+1782
-54
lines changed

8 files changed

+1782
-54
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ IF SUFFICIENT INFORMATION IS NOT PROVIDED VIA THE FOLLOWING TEMPLATE THE ISSUE M
2121
### Expected/desired behavior
2222
>
2323
24-
### Browser and Version?
24+
### Browser/OS and version?
2525
>
2626
2727
### Versions

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,6 @@ FakesAssemblies/
272272
# Node.js Tools for Visual Studio
273273
.ntvs_analysis.dat
274274
node_modules/
275-
package-lock.json
276275

277276
# Visual Studio 6 build log
278277
*.plg

Chapter1/README.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
## Overview
1717

18-
This sample demonstrates a how to [manage your B2C users with Microsoft Graph](https://docs.microsoft.com/azure/active-directory-b2c/microsoft-graph-get-started) via a vanilla JavaScript single-page application (SPA) using [delegated permissions](https://docs.microsoft.com/azure/active-directory/develop/delegated-and-app-perms), with the help of [Microsoft Authentication Library of JavaScript](https://github.com/AzureAD/microsoft-authentication-library-for-js) (MSAL.js) for authentication and [Microsoft Graph JavaScript Client Library](https://github.com/microsoftgraph/msgraph-sdk-javascript) for querying [Microsoft Graph](https://docs.microsoft.com/graph/overview).
18+
This sample demonstrates a how to [manage your B2C users with Microsoft Graph](https://docs.microsoft.com/azure/active-directory-b2c/microsoft-graph-get-started) via a vanilla JavaScript single-page application (SPA) using [delegated permissions](https://docs.microsoft.com/azure/active-directory/develop/delegated-and-app-perms), with the help of [Microsoft Authentication Library of JavaScript](https://github.com/AzureAD/microsoft-authentication-library-for-js) (MSAL.js) for authentication and [Microsoft Graph JavaScript SDK](https://github.com/microsoftgraph/msgraph-sdk-javascript) for querying [Microsoft Graph](https://docs.microsoft.com/graph/overview).
1919

2020
## Scenario
2121

@@ -26,11 +26,11 @@ This sample demonstrates a how to [manage your B2C users with Microsoft Graph](h
2626

2727
## Contents
2828

29-
| File/folder | Description |
30-
|-------------------|--------------------------------------------|
31-
| `authConfig.js` | Authentication parameters reside here. |
32-
| `authProvider.js` | Main authentication logic resides here. |
33-
| `graph.js` | Contains an implementation of MS Graph JavaScript SDK client |
29+
| File/folder | Description |
30+
|-------------------|---------------------------------------------------------------|
31+
| `authConfig.js` | Authentication parameters reside here. |
32+
| `authProvider.js` | Main authentication logic resides here. |
33+
| `graph.js` | Contains an implementation of MS Graph JavaScript SDK client. |
3434

3535
## Prerequisites
3636

@@ -47,7 +47,7 @@ Locate the root folder of the sample in a terminal. Then:
4747

4848
### Registration
4949

50-
> :information_source: If you would like to use an existing B2C app registration that you use for signing-in users with user-flows (audience type 3), you can do so. However, you won't be able to grant delegated permissions via the **Permissions** blade on the App Registration portal. Thanks to dynamic consent, this won't be an issue, as you will already sign-in with an admin account that can consent to these permissions for herself. See "[configure the code to use your app registration](#configure-the-code-to-use-your-app-registration)" section below for other differences.
50+
> :information_source: If you would like to use an existing B2C app registration that you use for signing-in users with user-flows (audience type 3), you can do so. However, you won't be able to grant delegated permissions via the **Permissions** blade on the App Registration portal. Still, because of [dynamic consent](https://docs.microsoft.com/azure/active-directory/develop/v2-permissions-and-consent), this won't be an issue, as you will already sign-in with an admin account that can consent to these permissions for herself. See "[configure the code to use your app registration](#configure-the-code-to-use-your-app-registration)" section below for other differences.
5151
5252
### Choose the Azure AD tenant where you want to create your applications
5353

@@ -99,7 +99,7 @@ Locate the root folder of the sample in a terminal. Then:
9999
## Explore the sample
100100

101101
1. Open your browser and navigate to `http://localhost:3000`.
102-
1. Click on the **sign-in** button on the top right corner.
102+
1. Click on the **sign-in** button on the top right corner (make sure to sign-in with an administrator account).
103103
1. Click on the **Get Users** button retrieve the users in your tenant.
104104

105105
![Screenshot](./ReadmeFiles/ch1_screenshot.png)
@@ -162,14 +162,16 @@ Finally, we create **MyAuthenticationProvider** class that implements `Authentic
162162
class MyAuthenticationProvider {
163163
async getAccessToken() {
164164
return new Promise(async(resolve, reject) => {
165+
166+
// here we get an access token for MS Graph
165167
const authResponse = await getTokenPopup(tokenRequest);
166168

167169
if (authResponse.accessToken && authResponse.accessToken.length !== 0) {
168170
resolve(authResponse.accessToken);
169171
} else {
170172
reject(Error("Error: cannot obtain access token."));
171173
}
172-
});
174+
});
173175
}
174176
}
175177
```
@@ -186,7 +188,7 @@ const clientOptions = {
186188
const client = MicrosoftGraph.Client.initWithMiddleware(clientOptions);
187189
```
188190

189-
After that, we can use for **CRUD** operations on Graph resources. For instance, to update a user account:
191+
After that, we can use it for **CRUD** operations on Graph resources. For instance, to update a user account:
190192

191193
```javascript
192194
async function updateUser(id, prop) {

0 commit comments

Comments
 (0)