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
description: An Angular SPA using MSAL Angular to sign-in users with Azure Active Directory and call a protected .NET Core web API
15
15
---
16
16
17
-
# An Angular SPA using MSAL Angular to sign-in users with Azure Active Directory and call a protected .NET Core web API
17
+
# Angular single-page application using MSAL Angular to sign-in users with Azure Active Directory and call a .NET Core web API
18
18
19
19
*[Overview](#overview)
20
20
*[Scenario](#scenario)
@@ -153,20 +153,20 @@ To manually register the apps, as a first step you'll need to:
153
153
154
154
1. All APIs must publish a minimum of one [scope](https://docs.microsoft.com/azure/active-directory/develop/v2-oauth2-auth-code-flow#request-an-authorization-code), also called [Delegated Permission](https://docs.microsoft.com/azure/active-directory/develop/v2-permissions-and-consent#permission-types), for the client's to obtain an access token for a *user* successfully. To publish a scope, follow these steps:
155
155
1. Select **Add a scope** button open the **Add a scope** screen and Enter the values as indicated below:
156
-
1. For **Scope name**, use `TodoList.Read`.
156
+
1. For **Scope name**, enter **TodoList.Read** (case-sensitive).
157
157
1. Select **Admins and users** options for **Who can consent?**.
158
-
1. For **Admin consent display name** type in the details, `e.g. Allow the users of the app msal-dotnet-api to read ToDo list items`.
159
-
1. For **Admin consent description** type in the details `e.g. Allows the app msal-dotnet-api to read the signed-in users ToDo list items.`
160
-
1. For **User consent display name** type in the details `e.g. Read ToDo list items as yourself`.
161
-
1. For **User consent description** type in the details `e.g. Allow the app msal-dotnet-api to read ToDo list items on your behalf.`
158
+
1. For **Admin consent display name** type in the details, `e.g. Allow the users of the app msal-dotnet-api to read Todolist items`.
159
+
1. For **Admin consent description** type in the details `e.g. Allows the app msal-dotnet-api to read the signed-in users Todolist items.`
160
+
1. For **User consent display name** type in the details `e.g. Read Todolist items as yourself`.
161
+
1. For **User consent description** type in the details `e.g. Allow the app msal-dotnet-api to read Todolist items on your behalf.`
162
162
1. Keep **State** as **Enabled**.
163
163
1. Select the **Add scope** button on the bottom to save this scope.
164
164
> Repeat the steps above for another scope named **TodoList.ReadWrite**
165
165
1. Select the **Manifest** blade on the left.
166
166
1. Set `accessTokenAcceptedVersion` property to **2**.
167
167
1. Select on **Save**.
168
168
169
-
> :information_source: Follow [the principle of least privilege](https://docs.microsoft.com/azure/active-directory/develop/secure-least-privileged-access) whenever you are publishing permissions for a web API.
169
+
> :information_source: Follow [the principle of least privilege](https://docs.microsoft.com/azure/active-directory/develop/secure-least-privileged-access) whenever you are publishing permissions for a web API.
170
170
171
171
##### Publish Application Permissions
172
172
@@ -175,7 +175,7 @@ To manually register the apps, as a first step you'll need to:
175
175
1. Select **Create app role**:
176
176
1. For **Display name**, enter a suitable name for your application permission, for instance **TodoList.Read.All**.
177
177
1. For **Allowed member types**, choose **Application** to ensure other applications can be granted this permission.
178
-
1. For **Value**, enter **TodoList.Read.All**.
178
+
1. For **Value**, enter **TodoList.Read.All** (case-sensitive).
179
179
1. For **Description**, enter **Allow this application to read every users Todo list items**.
180
180
1. Select **Apply** to save your changes.
181
181
> Repeat the steps above for another app permission named **TodoList.ReadWrite.All**
@@ -210,6 +210,12 @@ Open the project in your IDE (like Visual Studio or Visual Studio Code) to confi
210
210
1. Under **Supported account types**, select **Accounts in this organizational directory only**
211
211
1. Select **Register** to create the application.
212
212
1. In the **Overview** blade, find and note the **Application (client) ID**. You use this value in your app's configuration file(s) later in your code.
213
+
1. In the app's registration screen, select the **Authentication** blade to the left.
214
+
1. If you don't have a platform added, select **Add a platform** and select the **Single-page application** option.
215
+
1. In the **Redirect URI** section enter the following redirect URIs:
216
+
1. `http://localhost:4200/`
217
+
1. `http://localhost:4200/auth`
218
+
1. Click **Save** to save your changes.
213
219
1. Since this app signs-in users, we will now proceed to select **delegated permissions**, which is is required by apps signing-in users.
214
220
1. In the app's registration screen, select the **API permissions** blade in the left to open the page where we add access to the APIs that your application needs:
215
221
1. Select the **Add a permission** button and then,
0 commit comments