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
Copy file name to clipboardExpand all lines: README.md
+9-36Lines changed: 9 additions & 36 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,11 +21,9 @@ description: "This sample demonstrates a JavaScript SPA application calling a No
21
21
1.[Running the sample](#running-the-sample)
22
22
1.[Explore the sample](#explore-the-sample)
23
23
1.[About the code](#about-the-code)
24
-
1.[Deployment](#deployment)
25
24
1.[More information](#more-information)
26
25
1.[Community Help and Support](#community-help-and-support)
27
26
1.[Contributing](#contributing)
28
-
1.[Code of Conduct](#code-of-conduct)
29
27
30
28
## Overview
31
29
@@ -38,15 +36,15 @@ You will need a **client** application for calling the Web API. Choose:
38
36
## Scenario
39
37
40
38
1. The client application uses the [Microsoft Authentication Library for JavaScript (MSAL.js)](https://github.com/AzureAD/microsoft-authentication-library-for-js) to sign-in a user and obtain a JWT [Access Token](https://docs.microsoft.com/azure/active-directory/develop/access-tokens) from **Azure AD**.
41
-
2. The **Access Token** is used as a *bearer* token to authenticate the user when calling this Web API.
39
+
1. The **Access Token** is used as a *bearer* token to authenticate the user when calling this web API.
40
+
1. The web API responds with the name of the user obtained from the token claims.
|`AppCreationScripts`| Contains automation scripts for app registration. |
50
48
|`config.js`| Contains configuration parameters for the sample. |
51
49
|`index.js`| Main application logic resides here. |
52
50
|`process.json`| Contains configuration parameters for logging via Morgan. |
@@ -135,9 +133,11 @@ Open the project in your IDE (like Visual Studio or Visual Studio Code) to confi
135
133
> In the steps below, "ClientID" is the same as "Application ID" or "AppId".
136
134
137
135
1. Open the `config.json` file.
138
-
1. Find the key `clientID` and replace the existing value with the application ID (clientId) of the `active-directory-b2c-javascript-nodejs-webapi` application copied from the Azure portal.
139
-
1. Find the key `tenantID` and replace the existing value with your Azure AD tenant ID.
140
-
1. Find the key `audience` and replace the existing value with the application ID (clientId) of the `active-directory-b2c-javascript-nodejs-webapi` application copied from the Azure portal.
136
+
1. Find the key `tenantName` and replace the existing value with your **Azure AD** tenant's name e.g. `<your-tenant-name>.onmicrosoft.com`.
137
+
1. Find the key `clientID` and replace the existing value with the application ID (clientId) of the `active-directory-b2c-javascript-nodejs-webapi` application copied from the **Azure Portal**.
138
+
1. Find the key `audience` and replace the existing value with the application ID (clientId) of the `active-directory-b2c-javascript-nodejs-webapi` application copied from the **Azure Portal**.
139
+
1. Find the key `policyName` and replace the existing value with name of the policy you've created, e.g. `B2C_1_SUSI`.
140
+
1. Find the key `b2cDomain` and replace the existing value with your tenant Domain name e.g. `<your-tenant-name>.b2clogin.com`.
141
141
142
142
## Running the sample
143
143
@@ -159,6 +159,8 @@ Call this web API from your client application. Upon an authorized call, the web
159
159
});
160
160
```
161
161
162
+

163
+
162
164
> :information_source: Did the sample not work for you as expected? Then please reach out to us using the [GitHub Issues](../../../../issues) page.
163
165
164
166
## About the code
@@ -174,35 +176,6 @@ Call this web API from your client application. Upon an authorized call, the web
174
176
);
175
177
```
176
178
177
-
## Deployment
178
-
179
-
### Deployment to Azure App Services
180
-
181
-
There is one web project in this sample. To deploy it to **Azure App Services**, you'll need to:
182
-
183
-
- create an **Azure App Service**
184
-
- publish the projects to the **App Services**, and
185
-
- update its client(s) to call the web site instead of the local environment.
186
-
187
-
#### Create and publish `active-directory-b2c-javascript-nodejs-webapi` to an Azure App Services
188
-
189
-
1. Sign in to the [Azure portal](https://portal.azure.com).
190
-
1. Click `Create a resource` in the top left-hand corner, select **Web** --> **Web App**, and give your web site a name, for example, `active-directory-b2c-javascript-nodejs-webapi.azurewebsites.net`.
191
-
1. Next, select the `Subscription`, `Resource Group`, `App service plan and Location`. `OS` will be **Windows** and `Publish` will be **Code**.
192
-
1. Click `Create` and wait for the App Service to be created.
193
-
1. Once you get the `Deployment succeeded` notification, then click on `Go to resource` to navigate to the newly created App service.
194
-
1. Once the web site is created, locate it it in the **Dashboard** and click it to open **App Services** **Overview** screen.
195
-
196
-
> :information_source: If you would like to use **VS Code Azure Tools** extension for deployment, [watch the tutorial](https://docs.microsoft.com/azure/developer/javascript/tutorial-vscode-azure-app-service-node-01) offered by Microsoft Docs.
197
-
198
-
##### Update the Azure AD B2C app registration for `active-directory-b2c-javascript-nodejs-webapi`
199
-
200
-
1. Navigate back to to the [Azure portal](https://portal.azure.com).
201
-
In the left-hand navigation pane, select the **Azure Active Directory** service, and then select **App registrations (Preview)**.
202
-
1. In the resulting screen, select the `active-directory-b2c-javascript-nodejs-webapi` application.
203
-
1. From the *Branding* menu, update the **Home page URL**, to the address of your service, for example [https://active-directory-b2c-javascript-nodejs-webapi.azurewebsites.net](https://active-directory-b2c-javascript-nodejs-webapi-contoso.azurewebsites.net). Save the configuration.
204
-
1. Add the same URL in the list of values of the *Authentication -> Redirect URIs* menu. If you have multiple redirect URIs, make sure that there a new entry using the App service's URI for each redirect URI.
205
-
206
179
## More information
207
180
208
181
- [What is Azure Active Directory B2C?](https://docs.microsoft.com/azure/active-directory-b2c/overview)
0 commit comments