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

Commit 013bb94

Browse files
committed
2 parents c017b89 + 023639b commit 013bb94

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

3-Authorization-II/2-call-api-b2c/API/TodoListAPI/Controllers/TodoListController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace TodoListAPI.Controllers
1818
public class TodoListController : ControllerBase
1919
{
2020
// The Web API will only accept tokens 1) for users, and
21-
// 2) having the access_as_user scope for this API
21+
// 2) having the demo.read scope for this API
2222
static readonly string[] scopeRequiredByApi = new string[] { "demo.read" };
2323

2424
private readonly TodoContext _context;

3-Authorization-II/2-call-api-b2c/AppCreationScripts/sample.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
{
2828
"Resource": "service",
2929
"DelegatedPermissions": [
30-
"access_as_user"
30+
"demo.read"
3131
]
3232
}
3333
],
@@ -42,7 +42,7 @@
4242
{
4343
"App": "service",
4444
"SettingKind": "Replace",
45-
"SettingFile": "\\..\\API\\appsettings.json",
45+
"SettingFile": "\\..\\API\\TodoListAPI\\appsettings.json",
4646
"Mappings": [
4747
{
4848
"key": "Enter the domain of your Azure AD tenant, e.g. 'contoso.onmicrosoft.com'",

3-Authorization-II/2-call-api-b2c/README-incremental.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ This sample demonstrates an Angular single-page application (SPA) calling a ASP.
3939

4040
```console
4141
cd ms-identity-javascript-angular-tutorial
42-
cd 3-Authorization-II/2-call-api-b2c/API
42+
cd 3-Authorization-II/2-call-api-b2c/API/TodoListAPI
4343
dotnet restore
4444
```
4545

@@ -88,7 +88,7 @@ The first thing that we need to do is to declare the unique [resource](https://d
8888
- For this sample, accept the proposed Application ID URI (`https://{tenantName}.onmicrosoft.com/{clientId}`) by selecting **Save**.
8989
1. All APIs have to publish a minimum of one [scope](https://docs.microsoft.com/azure/active-directory/develop/v2-oauth2-auth-code-flow#request-an-authorization-code) for the client's to obtain an access token successfully. To publish a scope, follow the following steps:
9090
- Select **Add a scope** button open the **Add a scope** screen and Enter the values as indicated below:
91-
- For **Scope name**, use `access_as_user`.
91+
- For **Scope name**, use `demo.read`.
9292
- For **Admin consent display name** type `Access msal-dotnet-api`.
9393
- For **Admin consent description** type `Allows the app to access msal-dotnet-api as the signed-in user.`
9494
- Keep **State** as **Enabled**.
@@ -104,9 +104,9 @@ Open the project in your IDE (like Visual Studio or Visual Studio Code) to confi
104104
> In the steps below, "ClientID" is the same as "Application ID" or "AppId".
105105
106106
1. Open the `API\appsettings.json` file.
107-
1. Find the key `Instance` and replace the existing value with your Azure AD B2C tenant name.
107+
1. Find the key `Instance` and replace the existing value with your Azure AD B2C tenant name e.g.`https://{tenantName}.b2clogin.com`.
108108
1. Find the key `ClientId` and replace the existing value with the application ID (clientId) of `msal-dotnet-api` app copied from the Azure portal.
109-
1. Find the key `Domain` and replace the existing value with your Azure AD B2C tenant name.
109+
1. Find the key `Domain` and replace the existing value with your Azure AD B2C tenant name e.g.`{tenantName}.onmicrosoft.com`
110110

111111
1. Find the key `SignUpSignInPolicyId` and replace the existing value with your sign-up/sign-in user-flow string e.g. `b2c_1_susi`.
112112
1. Find the key `EditProfilePolicyId` and replace the existing value with your profile-edit user-flow string e.g. `b2c_1_edit`.
@@ -141,7 +141,7 @@ Open the project in your IDE (like Visual Studio or Visual Studio Code) to confi
141141
142142
1. Open the `SPA\src\app\auth-config.ts` file.
143143
1. Find the key `clientId` and replace the existing value with the application ID (clientId) of `msal-angular-spa` app copied from the Azure portal.
144-
1. Find the key `protectedResources.todoListApi.scopes` and replace the existing value with the scope of the web API that you have just exposed during the web API registration steps, for example `https://{tenantName}.onmicrosoft.com/{service_clientId}/access_as_user`
144+
1. Find the key `protectedResources.todoListApi.scopes` and replace the existing value with the scope of the web API that you have just exposed during the web API registration steps, for example `https://{tenantName}.onmicrosoft.com/{service_clientId}/demo.read`
145145

146146
To setup your B2C user-flows, do the following:
147147

@@ -161,7 +161,7 @@ Using a command line interface such as VS Code integrated terminal, locate the a
161161
In a separate console window, execute the following commands:
162162

163163
```console
164-
cd API
164+
cd API/TodoListAPI
165165
dotnet run
166166
```
167167

3-Authorization-II/2-call-api-b2c/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ or download and extract the repository .zip file.
5555

5656
```console
5757
cd ms-identity-javascript-angular-tutorial
58-
cd 3-Authorization-II/2-call-api-b2c/API
58+
cd 3-Authorization-II/2-call-api-b2c/API/TodoListAPI
5959
dotnet restore
6060
```
6161

@@ -111,7 +111,7 @@ The first thing that we need to do is to declare the unique [resource](https://d
111111
- For this sample, accept the proposed Application ID URI (`https://{tenantName}.onmicrosoft.com/{clientId}`) by selecting **Save**.
112112
1. All APIs have to publish a minimum of one [scope](https://docs.microsoft.com/azure/active-directory/develop/v2-oauth2-auth-code-flow#request-an-authorization-code) for the client's to obtain an access token successfully. To publish a scope, follow the following steps:
113113
- Select **Add a scope** button open the **Add a scope** screen and Enter the values as indicated below:
114-
- For **Scope name**, use `access_as_user`.
114+
- For **Scope name**, use `demo.read`.
115115
- For **Admin consent display name** type `Access msal-dotnet-api`.
116116
- For **Admin consent description** type `Allows the app to access msal-dotnet-api as the signed-in user.`
117117
- Keep **State** as **Enabled**.
@@ -127,9 +127,9 @@ Open the project in your IDE (like Visual Studio or Visual Studio Code) to confi
127127
> In the steps below, "ClientID" is the same as "Application ID" or "AppId".
128128
129129
1. Open the `API\appsettings.json` file.
130-
1. Find the key `Instance` and replace the existing value with your Azure AD B2C tenant name.
130+
1. Find the key `Instance` and replace the existing value with your Azure AD B2C tenant name e.g.`https://{tenantName}.b2clogin.com`.
131131
1. Find the key `ClientId` and replace the existing value with the application ID (clientId) of `msal-dotnet-api` app copied from the Azure portal.
132-
1. Find the key `Domain` and replace the existing value with your Azure AD B2C tenant name.
132+
1. Find the key `Domain` and replace the existing value with your Azure AD B2C tenant name e.g.`{tenantName}.onmicrosoft.com`
133133

134134
1. Find the key `SignUpSignInPolicyId` and replace the existing value with your sign-up/sign-in user-flow string e.g. `b2c_1_susi`.
135135
1. Find the key `EditProfilePolicyId` and replace the existing value with your profile-edit user-flow string e.g. `b2c_1_edit`.
@@ -164,7 +164,7 @@ Open the project in your IDE (like Visual Studio or Visual Studio Code) to confi
164164
165165
1. Open the `SPA\src\app\auth-config.ts` file.
166166
1. Find the key `clientId` and replace the existing value with the application ID (clientId) of `msal-angular-spa` app copied from the Azure portal.
167-
1. Find the key `protectedResources.todoListApi.scopes` and replace the existing value with the scope of the web API that you have just exposed during the web API registration steps, for example `https://{tenantName}.onmicrosoft.com/{service_clientId}/access_as_user`
167+
1. Find the key `protectedResources.todoListApi.scopes` and replace the existing value with the scope of the web API that you have just exposed during the web API registration steps, for example `https://{tenantName}.onmicrosoft.com/{service_clientId}/demo.read`
168168

169169
To setup your B2C user-flows, do the following:
170170

@@ -184,7 +184,7 @@ Using a command line interface such as VS Code integrated terminal, locate the a
184184
In a separate console window, execute the following commands:
185185

186186
```console
187-
cd API
187+
cd API/TodoListAPI
188188
dotnet run
189189
```
190190

0 commit comments

Comments
 (0)