Skip to content

Commit 7458c5e

Browse files
committed
review changes
1 parent 85df438 commit 7458c5e

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

articles/active-directory/develop/includes/desktop-app/quickstart-nodejs-electron.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ To register your application and add the app's registration information to your
3838
1. Select **Register** to create the application.
3939
1. Under **Manage**, select **Authentication**.
4040
1. Select **Add a platform** > **Mobile and desktop applications**.
41-
1. In the **Redirect URIs** section, enter the redirect URI suggested by the app registration portal, e.g. `msalfa29b4c9-7675-4b61-8a0a-bf7b2b4fda91://auth`.
41+
1. In the **Redirect URIs** section, enter `http://localhost`.
4242
1. Select **Configure**.
4343

4444
#### Step 2: Download the Electron sample project
@@ -62,7 +62,7 @@ Your file should look similar to below:
6262

6363
```javascript
6464
const AAD_ENDPOINT_HOST = "https://login.microsoftonline.com/"; // include the trailing slash
65-
const REDIRECT_URI = "msalfa29b4c9-7675-4b61-8a0a-bf7b2b4fda91://auth";
65+
6666
const msalConfig = {
6767
auth: {
6868
clientId: "fa29b4c9-7675-4b61-8a0a-bf7b2b4fda91",
@@ -80,14 +80,11 @@ Your file should look similar to below:
8080
}
8181

8282
const GRAPH_ENDPOINT_HOST = "https://graph.microsoft.com/"; // include the trailing slash
83+
8384
const protectedResources = {
8485
graphMe: {
8586
endpoint: `${GRAPH_ENDPOINT_HOST}v1.0/me`,
8687
scopes: ["User.Read"],
87-
},
88-
graphMessages: {
89-
endpoint: `${GRAPH_ENDPOINT_HOST}v1.0/me/messages`,
90-
scopes: ["Mail.Read"],
9188
}
9289
};
9390

@@ -121,7 +118,7 @@ Your file should look similar to below:
121118

122119
### How the sample works
123120

124-
When a user selects the **Sign In** button for the first time, get `getTokenInteractive` method of *AuthProvider.js* is called. This method redirects the user to sign-in with the *Microsoft identity platform endpoint* and validate the user's credentials, and then obtains an **authorization code**. This code is then exchanged for an access token using the `acquireTokenByCode` method of MSAL Node.
121+
When a user selects the **Sign In** button for the first time, `acquireTokenInteractive` method of MSAL Node is called. This method redirects the user to sign-in with the *Microsoft identity platform endpoint*, obtains an **authorization code**, and then exchanges it for an access token.
125122

126123
### MSAL Node
127124

articles/active-directory/develop/tutorial-v2-nodejs-desktop.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ Fill in these details with the values you obtain from Azure app registration por
129129
- `Enter_the_Cloud_Instance_Id_Here`: The Azure cloud instance in which your application is registered.
130130
- For the main (or *global*) Azure cloud, enter `https://login.microsoftonline.com/`.
131131
- For **national** clouds (for example, China), you can find appropriate values in [National clouds](authentication-national-cloud.md).
132-
- `Enter_the_Redirect_Uri_Here`: The Redirect Uri of the application you registered `http://localhost`.
133132
- `Enter_the_Graph_Endpoint_Here` is the instance of the Microsoft Graph API the application should communicate with.
134133
- For the **global** Microsoft Graph API endpoint, replace both instances of this string with `https://graph.microsoft.com/`.
135134
- For endpoints in **national** cloud deployments, see [National cloud deployments](/graph/deployments) in the Microsoft Graph documentation.
@@ -158,13 +157,13 @@ If you consent to the requested permissions, the web applications displays your
158157

159158
## Test web API call
160159

161-
After you sign in, select **See Profile** to view the user profile information returned in the response from the call to the Microsoft Graph API. After consent, you'll view the messages returned in the response from the call to the Microsoft Graph API:
160+
After you sign in, select **See Profile** to view the user profile information returned in the response from the call to the Microsoft Graph API. After consent, you'll view the profile information returned in the response:
162161

163162
:::image type="content" source="media/tutorial-v2-nodejs-desktop/desktop-04-profile.png" alt-text="profile information from Microsoft Graph":::
164163

165164
## How the application works
166165

167-
When a user selects the **Sign In** button for the first time, get `getTokenInteractive` method of *AuthProvider.js* is called. This method redirects the user to sign-in with the Microsoft identity platform endpoint and validates the user's credentials, obtains an **authorization code** and then exchanges that code for an ID token, access token, and refresh token. MSAL Node also caches these tokens for future use.
166+
When a user selects the **Sign In** button for the first time, the `acquireTokenInteractive` method of MSAL Node. This method redirects the user to sign-in with the Microsoft identity platform endpoint and validates the user's credentials, obtains an **authorization code** and then exchanges that code for an ID token, access token, and refresh token. MSAL Node also caches these tokens for future use.
168167

169168
The ID token contains basic information about the user, like their display name. The access token has a limited lifetime and expires after 24 hours. If you plan to use these tokens for accessing protected resource, your back-end server *must* validate it to guarantee the token was issued to a valid user for your application.
170169

0 commit comments

Comments
 (0)