You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> This quickstart uses MSAL.js 2.0 with the Authorization Code flow. To use MSAL.js 1.0 with the implicit flow, view [this quickstart](https://docs.microsoft.com/azure/active-directory/develop/quickstart-v2-javascript)
27
27
28
-
In this quickstart, you use a code sample to learn how a JavaScript single-page application (SPA) can sign in users of personal accounts, work accounts, and school accounts. A JavaScript SPA can also get an access token to call the Microsoft Graph API or any web API. (See [How the sample works](#how-the-sample-works) for an illustration.)
28
+
In this quickstart, you use a code sample to learn how a JavaScript single-page application (SPA) can sign in users of personal accounts, work accounts, and school accounts. A JavaScript SPA can also get an access token to call the Microsoft Graph API or any web API. See [How the sample works](#how-the-sample-works) for an illustration.
29
29
30
30
## Prerequisites
31
31
@@ -40,9 +40,9 @@ In this quickstart, you use a code sample to learn how a JavaScript single-page
40
40
>
41
41
> ### Option 1 (Express): Register and auto configure your app and then download your code sample
42
42
>
43
-
> 1. Sign in to the [Azure portal](https://portal.azure.com) by using either a work or school account, or a personal Microsoft account.
43
+
> 1. Sign in to the [Azure portal](https://portal.azure.com).
44
44
> 1. If your account gives you access to more than one tenant, select the account at the top right, and then set your portal session to the Azure Active Directory (Azure AD) tenant you want to use.
45
-
> 1.Go to the new [Azure portal - App registrations](https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationsListBlade/quickStartType/JavascriptSpaQuickstartPage/sourceType/docs) pane.
> 1. Under **Supported account types**, select **Accounts in any organizational directory and personal Microsoft accounts**.
48
48
> 1. Select **Register**.
@@ -52,10 +52,10 @@ In this quickstart, you use a code sample to learn how a JavaScript single-page
52
52
>
53
53
> #### Step 1: Register your application
54
54
>
55
-
> 1. Sign in to the [Azure portal](https://portal.azure.com) by using either a work or school account, or a personal Microsoft account.
55
+
> 1. Sign in to the [Azure portal](https://portal.azure.com).
56
56
>
57
57
> 1. If your account gives you access to more than one tenant, select your account at the top right, and then set your portal session to the Azure AD tenant you want to use.
58
-
> 1.Go to the Microsoft identity platform for developers [App registrations](https://go.microsoft.com/fwlink/?linkid=2083908) page.
> 1. When the **Register an application** page appears, enter a name for your application.
61
61
> 1. Under **Supported account types**, select **Accounts in any organizational directory and personal Microsoft accounts**.
@@ -79,10 +79,10 @@ In this quickstart, you use a code sample to learn how a JavaScript single-page
79
79
> [!div renderon="docs"]
80
80
> To run the project with a web server by using Node.js, [download the core project files](https://github.com/Azure-Samples/ms-identity-javascript-v2/archive/quickstart.zip).
81
81
82
-
> [!div renderon="portal"]
82
+
> [!div renderon="portal" class="sxs-lookup"]
83
83
> Run the project with a web server by using Node.js
> [Download the code sample](https://github.com/Azure-Samples/ms-identity-javascript-v2/archive/quickstart.zip)
87
87
88
88
> [!div renderon="docs"]
@@ -107,7 +107,7 @@ In this quickstart, you use a code sample to learn how a JavaScript single-page
107
107
>
108
108
>```
109
109
110
-
> [!div renderon="portal"]
110
+
> [!div renderon="portal" class="sxs-lookup"]
111
111
> > [!NOTE]
112
112
> > `Enter_the_Supported_Account_Info_Here`
113
113
@@ -122,7 +122,7 @@ In this quickstart, you use a code sample to learn how a JavaScript single-page
122
122
> - If your application supports *accounts in any organizational directory and personal Microsoft accounts*, replace this value with **common**. To restrict support to *personal Microsoft accounts only*, replace this value with **consumers**.
123
123
> - *\<Enter_the_Redirect_Uri_Here>* is `http://localhost:3000`
124
124
>> [!TIP]
125
-
>> To find the values of**Application (client) ID**, **Directory (tenant) ID**, and **Supported account types**, go to the app's **Overview** page in the Azure portal.
125
+
>> To find the values of**Application (client) ID**, **Directory (tenant) ID**, and **Supported account types**, go to the app registration's **Overview** page in the Azure portal.
126
126
>
127
127
> [!div class="sxs-lookup" renderon="portal"]
128
128
> #### Step 3: Your app is configured and ready to run
@@ -148,22 +148,22 @@ In this quickstart, you use a code sample to learn how a JavaScript single-page
148
148
> [!div renderon="docs"]
149
149
>
150
150
> Where:
151
-
>-*\<Enter_the_Graph_Endpoint_Here>* is the endpoint that API calls will be made against. For the main or global Microsoft Graph API service, simply enter `https://graph.microsoft.com`. For more information, see [National cloud deployment](https://docs.microsoft.com/graph/deployments)
151
+
>-*\<Enter_the_Graph_Endpoint_Here>* is the endpoint that API calls will be made against. For the main or global Microsoft Graph API service, enter `https://graph.microsoft.com`. For more information, see [National cloud deployment](https://docs.microsoft.com/graph/deployments).
152
152
>
153
153
> #### Step 4: Run the project
154
154
155
155
Run the project with a web server by using [Node.js](https://nodejs.org/en/download/):
156
156
157
-
1. To start the server, run the following command from the project directory:
158
-
```batch
157
+
1. To start the server, run the following commands from within the project directory:
158
+
```bash
159
159
npm install
160
160
npm start
161
161
```
162
-
1.Open a web browser and go to `http://localhost:3000/`.
162
+
1.Browse to `http://localhost:3000/`.
163
163
164
164
1. Select **Sign In** to start the sign-in, and then call Microsoft Graph API.
165
165
166
-
After the browser loads the application, select **Sign In**. The first time that you sign in, you're prompted to provide your consent to allow the application to access your profile and to sign you in. After you're signed in successfully, your user profile information should be displayed on the page.
166
+
After the browser loads the application, select **Sign In**. The first time you sign in, you're prompted to provide your consent to allow the application to access your profile and sign you in. After you're signed in successfully, your user profile information should be displayed on the page.
167
167
168
168
## More information
169
169
@@ -181,20 +181,17 @@ The MSAL library signs in users and requests the tokens that are used to access
181
181
> [!TIP]
182
182
> You can replace the preceding version with the latest released version under [MSAL.js releases](https://github.com/AzureAD/microsoft-authentication-library-for-js/releases).
183
183
184
-
Alternatively, if you have Node.js installed, you can download the latest version through Node.js Package Manager (npm):
184
+
Alternatively, if you have Node.js installed, you can download the latest version by using the Node.js Package Manager (npm):
185
185
186
186
```batch
187
187
npm install msal
188
188
```
189
189
190
190
## Next steps
191
191
192
+
The [MSAL.js GitHub repo](https://github.com/AzureAD/microsoft-authentication-library-for-js) contains additional library documentation, a FAQ, and provides issue support.
193
+
192
194
For a more detailed step-by-step guide on building the application for this quickstart, see:
193
195
194
196
> [!div class="nextstepaction"]
195
197
> [Tutorial to sign in and call MS Graph](https://docs.microsoft.com/azure/active-directory/develop/tutorial-v2-javascript-auth-code)
196
-
197
-
To browse the MSAL repo for documentation, FAQ, issues, and more, see:
0 commit comments