Skip to content

Commit ec18b4d

Browse files
committed
More renaming for consistency
1 parent 3ef8aab commit ec18b4d

File tree

22 files changed

+30
-30
lines changed

22 files changed

+30
-30
lines changed

1-WebApp-OIDC/1-6-SignOut/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ public static IServiceCollection AddSignIn(this IServiceCollection services,
7373

7474
### Clearing the token cache
7575

76-
Your application can also intercept the logout event, for instance to clear the entry of the token cache associated with the account that signed out. We'll see in the second part of this tutorial (about the Web app calling a Web API), that the web app will store access tokens for the user in a cache. Intercepting the logout callback enables your web application to remove the user from the token cache. This is illustrated in the `AddWebAppCallProtectedWebApi()` method of [StartupHelper.cs L137-143](https://github.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/blob/b87a1d859ff9f9a4a98eb7b701e6a1128d802ec5/Microsoft.Identity.Web/StartupHelpers.cs#L137-L143)
76+
Your application can also intercept the logout event, for instance to clear the entry of the token cache associated with the account that signed out. We'll see in the second part of this tutorial (about the Web app calling a Web API), that the web app will store access tokens for the user in a cache. Intercepting the logout callback enables your web application to remove the user from the token cache. This is illustrated in the `AddWebAppCallsProtectedWebApi()` method of [StartupHelper.cs L137-143](https://github.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/blob/b87a1d859ff9f9a4a98eb7b701e6a1128d802ec5/Microsoft.Identity.Web/StartupHelpers.cs#L137-L143)
7777

7878
```CSharp
79-
public static IServiceCollection AddWebAppCallProtectedWebApi(this IServiceCollection services, IEnumerable<string> initialScopes)
79+
public static IServiceCollection AddWebAppCallsProtectedWebApi(this IServiceCollection services, IEnumerable<string> initialScopes)
8080
{
8181
services.AddTokenAcquisition();
8282

2-WebApp-graph-user/2-1-Call-MSGraph/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ After the following lines in the ConfigureServices(IServiceCollection services)
103103
// Token acquisition service based on MSAL.NET
104104
// and chosen token cache implementation
105105
services.AddSignIn(Configuration)
106-
.AddWebAppCallProtectedWebApi(Configuration, new string[] { Constants.ScopeUserRead })
106+
.AddWebAppCallsProtectedWebApi(Configuration, new string[] { Constants.ScopeUserRead })
107107
.AddInMemoryTokenCache();
108108
```
109109

2-WebApp-graph-user/2-1-Call-MSGraph/Startup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public void ConfigureServices(IServiceCollection services)
3838
// Token acquisition service based on MSAL.NET
3939
// and chosen token cache implementation
4040
services.AddSignIn(Configuration)
41-
.AddWebAppCallProtectedWebApi(Configuration, new string[] { Constants.ScopeUserRead })
41+
.AddWebAppCallsProtectedWebApi(Configuration, new string[] { Constants.ScopeUserRead })
4242
.AddInMemoryTokenCaches();
4343

4444
/*

2-WebApp-graph-user/2-2-TokenCache/README-incremental-instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public void ConfigureServices(IServiceCollection services)
9797
// Token acquisition service based on MSAL.NET
9898
// and the Sql server based token cache implementation
9999
services.AddMicrosoftIdentityPlatformAuthentication(Configuration)
100-
.AddWebAppCallProtectedWebApi(new string[] { Constants.ScopeUserRead })
100+
.AddWebAppCallsProtectedWebApi(new string[] { Constants.ScopeUserRead })
101101
.AddSqlAppTokenCache(Configuration)
102102
.AddSqlPerUserTokenCache(Configuration);
103103
```

2-WebApp-graph-user/2-2-TokenCache/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ public void ConfigureServices(IServiceCollection services)
183183
// Token acquisition service based on MSAL.NET
184184
// and the Sql server based token cache implementation
185185
services.AddSignIn(Configuration)
186-
.AddWebAppCallProtectedWebApi(Configuration, new string[] { Constants.ScopeUserRead })
186+
.AddWebAppCallsProtectedWebApi(Configuration, new string[] { Constants.ScopeUserRead })
187187
.AddDistributedTokenCaches();
188188

189189
services.AddDistributedSqlServerCache(options =>

2-WebApp-graph-user/2-2-TokenCache/Startup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ dotnet tool install --global dotnet-sql-cache
5050
// Token acquisition service based on MSAL.NET
5151
// and chosen token cache implementation
5252
services.AddSignIn(Configuration)
53-
.AddWebAppCallProtectedWebApi(Configuration, new string[] { Constants.ScopeUserRead })
53+
.AddWebAppCallsProtectedWebApi(Configuration, new string[] { Constants.ScopeUserRead })
5454
.AddDistributedTokenCaches();
5555

5656
services.AddDistributedSqlServerCache(options =>

2-WebApp-graph-user/2-3-Multi-Tenant/Startup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public void ConfigureServices(IServiceCollection services)
7676

7777
// Sign-in users with the Microsoft identity platform
7878
services.AddSignIn(Configuration)
79-
.AddWebAppCallProtectedWebApi(Configuration, new string[] { GraphScope.UserReadAll })
79+
.AddWebAppCallsProtectedWebApi(Configuration, new string[] { GraphScope.UserReadAll })
8080
.AddInMemoryTokenCaches();
8181

8282
services.Configure<OpenIdConnectOptions>(AzureADDefaults.OpenIdScheme, options =>

2-WebApp-graph-user/2-4-Sovereign-Call-MSGraph/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ After the following lines in the ConfigureServices(IServiceCollection services)
9494
// Token acquisition service based on MSAL.NET
9595
// and chosen token cache implementation
9696
services.AddSignIn(Configuration)
97-
.AddWebAppCallProtectedWebApi(new string[] { Constants.ScopeUserRead })
97+
.AddWebAppCallsProtectedWebApi(new string[] { Constants.ScopeUserRead })
9898
.AddInMemoryTokenCache();
9999
```
100100

2-WebApp-graph-user/2-4-Sovereign-Call-MSGraph/Startup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public void ConfigureServices(IServiceCollection services)
3737
// Token acquisition service based on MSAL.NET
3838
// and chosen token cache implementation
3939
services.AddSignIn(Configuration)
40-
.AddWebAppCallProtectedWebApi(Configuration, new string[] { Constants.ScopeUserRead })
40+
.AddWebAppCallsProtectedWebApi(Configuration, new string[] { Constants.ScopeUserRead })
4141
.AddInMemoryTokenCaches();
4242

4343
// Add Graph

3-WebApp-multi-APIs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ After the following lines in the ConfigureServices(IServiceCollection services)
8585
// Token acquisition service based on MSAL.NET
8686
// and chosen token cache implementation
8787
services.AddSignIn(Configuration)
88-
.AddWebAppCallProtectedWebApi(new string[] { Constants.ScopeUserRead })
88+
.AddWebAppCallsProtectedWebApi(new string[] { Constants.ScopeUserRead })
8989
.AddInMemoryTokenCache();
9090
services.AddHttpClient<IArmOperations, ArmApiOperationService>();
9191
```

3-WebApp-multi-APIs/Startup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public void ConfigureServices(IServiceCollection services)
3838
// Token acquisition service based on MSAL.NET
3939
// and chosen token cache implementation
4040
services.AddSignIn(Configuration)
41-
.AddWebAppCallProtectedWebApi(Configuration, new string[] { Constants.ScopeUserRead })
41+
.AddWebAppCallsProtectedWebApi(Configuration, new string[] { Constants.ScopeUserRead })
4242
.AddInMemoryTokenCaches();
4343

4444
// Add APIs

4-WebApp-your-API/Client/Startup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public void ConfigureServices(IServiceCollection services)
4545
// Token acquisition service based on MSAL.NET
4646
// and chosen token cache implementation
4747
services.AddSignIn(Configuration)
48-
.AddWebAppCallProtectedWebApi(Configuration, new string[] { Configuration["TodoList:TodoListScope"] })
48+
.AddWebAppCallsProtectedWebApi(Configuration, new string[] { Configuration["TodoList:TodoListScope"] })
4949
.AddInMemoryTokenCaches();
5050

5151
// Add APIs

4-WebApp-your-API/README-incremental-instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ Add a reference to the `Microsoft.Identity.Web` library if not already present.
208208

209209
```CSharp
210210
services.AddSignIn(Configuration)
211-
.AddWebAppCallProtectedWebApi(new string[] { Configuration["TodoList:TodoListScope"] })
211+
.AddWebAppCallsProtectedWebApi(new string[] { Configuration["TodoList:TodoListScope"] })
212212
.AddInMemoryTokenCaches();
213213
```
214214

4-WebApp-your-API/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ NOTE: Remember, the To-Do list is stored in memory in this `TodoListService` app
249249
250250
```CSharp
251251
services.AddSignIn(Configuration)
252-
.AddWebAppCallProtectedWebApi(new string[] { Configuration["TodoList:TodoListScope"] })
252+
.AddWebAppCallsProtectedWebApi(new string[] { Configuration["TodoList:TodoListScope"] })
253253
.AddInMemoryTokenCaches();
254254
```
255255
@@ -280,7 +280,7 @@ NOTE: Remember, the To-Do list is stored in memory in this `TodoListService` app
280280

281281
```CSharp
282282
services.AddSignIn(Configuration)
283-
.AddWebAppCallProtectedWebApi(new string[] { Configuration["TodoList:TodoListScope"] })
283+
.AddWebAppCallsProtectedWebApi(new string[] { Configuration["TodoList:TodoListScope"] })
284284
.AddInMemoryTokenCaches();
285285
```
286286
1. Update the `Configure` method to include **app.UseAuthentication();** before **app.UseMvc();**

5-WebApp-AuthZ/5-1-Roles/README-incremental-instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ The following files have the code that would be of interest to you.
233233
234234
//This enables your application to use the Microsoft identity platform endpoint. This endpoint is capable of signing-in users both with their Work and School and Microsoft Personal accounts.
235235
services.AddSignIn(Configuration)
236-
.AddWebAppCallProtectedWebApi(Configuration, new string[] { "User.Read", "Directory.Read.All" }) // Adds support for the MSAL library with the permissions necessary to retrieve the signed-in user's group info in case of a token overage
236+
.AddWebAppCallsProtectedWebApi(Configuration, new string[] { "User.Read", "Directory.Read.All" }) // Adds support for the MSAL library with the permissions necessary to retrieve the signed-in user's group info in case of a token overage
237237
.AddInMemoryTokenCaches(); // Adds aspnetcore MemoryCache as Token cache provider for MSAL.
238238
239239
services.AddMSGraphService(Configuration); // Adds the IMSGraphService as an available service for this app.

5-WebApp-AuthZ/5-1-Roles/Startup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public void ConfigureServices(IServiceCollection services)
4747
// Token acquisition service based on MSAL.NET
4848
// and chosen token cache implementation
4949
services.AddSignIn(Configuration)
50-
.AddWebAppCallProtectedWebApi(Configuration, new string[] { Constants.ScopeUserRead })
50+
.AddWebAppCallsProtectedWebApi(Configuration, new string[] { Constants.ScopeUserRead })
5151
.AddInMemoryTokenCaches();
5252

5353
// Add Graph

5-WebApp-AuthZ/5-2-Groups/README-incremental-instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ The following files have the code that would be of interest to you..
203203

204204
//This enables your application to use the Microsoft identity platform endpoint. This endpoint is capable of signing-in users both with their Work and School and Microsoft Personal accounts.
205205
services.AddSignIn(Configuration)
206-
.AddWebAppCallProtectedWebApi(Configuration, new string[] { "User.Read", "Directory.Read.All" }) // Adds support for the MSAL library with the permissions necessary to retrieve the signed-in user's group info in case of a token overage
206+
.AddWebAppCallsProtectedWebApi(Configuration, new string[] { "User.Read", "Directory.Read.All" }) // Adds support for the MSAL library with the permissions necessary to retrieve the signed-in user's group info in case of a token overage
207207
.AddInMemoryTokenCaches(); // Adds aspnetcore MemoryCache as Token cache provider for MSAL.
208208

209209
services.AddMSGraphService(Configuration); // Adds the IMSGraphService as an available service for this app.

5-WebApp-AuthZ/5-2-Groups/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ The following files have the code that would be of interest to you..
296296

297297
//This enables your application to use the Microsoft identity platform endpoint. This endpoint is capable of signing-in users both with their Work and School and Microsoft Personal accounts.
298298
services.AddSignIn(Configuration)
299-
.AddWebAppCallProtectedWebApi(Configuration, new string[] { "User.Read", "Directory.Read.All" }) // Adds support for the MSAL library with the permissions necessary to retrieve the signed-in user's group info in case of a token overage
299+
.AddWebAppCallsProtectedWebApi(Configuration, new string[] { "User.Read", "Directory.Read.All" }) // Adds support for the MSAL library with the permissions necessary to retrieve the signed-in user's group info in case of a token overage
300300
.AddInMemoryTokenCaches(); // Adds aspnetcore MemoryCache as Token cache provider for MSAL.
301301

302302
services.AddMSGraphService(Configuration); // Adds the IMSGraphService as an available service for this app.

5-WebApp-AuthZ/5-2-Groups/Startup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public void ConfigureServices(IServiceCollection services)
3535

3636
// Sign-in users with the Microsoft identity platform
3737
services.AddSignIn(Configuration)
38-
.AddWebAppCallProtectedWebApi(Configuration, new string[] { "User.Read", "Directory.Read.All" })
38+
.AddWebAppCallsProtectedWebApi(Configuration, new string[] { "User.Read", "Directory.Read.All" })
3939
.AddInMemoryTokenCaches();
4040

4141
services.AddMSGraphService(Configuration);

Microsoft.Identity.Web/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ See also:
6363

6464
### Web apps that sign in users and call web apis on behalf of the signed-in user - startup.cs
6565

66-
If moreover you want your Web app to call web APIS, you'll need to add a line with `.AddWebAppCallProtectedWebApi()`, and choose a token cache implementation, for instance `.AddInMemoryTokenCaches()`
66+
If moreover you want your Web app to call web APIS, you'll need to add a line with `.AddWebAppCallsProtectedWebApi()`, and choose a token cache implementation, for instance `.AddInMemoryTokenCaches()`
6767

6868
```CSharp
6969
using Microsoft.Identity.Web;
@@ -76,7 +76,7 @@ public class Startup
7676
{
7777
...
7878
services.AddSignIn(Configuration)
79-
.AddWebAppCallProtectedWebApi(new string[] { scopesToRequest })
79+
.AddWebAppCallsProtectedWebApi(new string[] { scopesToRequest })
8080
.AddInMemoryTokenCaches();
8181
...
8282
}
@@ -110,7 +110,7 @@ public class HomeController : Controller
110110
...
111111
```
112112

113-
Then in your controller actions, you'll need to call: `ITokenAcquisition.GetAccessTokenOnBehalfOfUserAsync` passing the scopes for which to request a token. The other methods of ITokenAcquisition are used from the `AddWebAppCallProtectedWebApi()` method and similar methods for web APIs (see below).
113+
Then in your controller actions, you'll need to call: `ITokenAcquisition.GetAccessTokenOnBehalfOfUserAsync` passing the scopes for which to request a token. The other methods of ITokenAcquisition are used from the `AddWebAppCallsProtectedWebApi()` method and similar methods for web APIs (see below).
114114

115115
```CSharp
116116
[Authorize]
@@ -194,7 +194,7 @@ See also:
194194
195195
### Protected web APIs that call downstream APIs on behalf of a user - Startup.cs
196196

197-
If moreover you want your web API to call downstream web APIS, you'll need to add lines with `.AddProtectedApiCallsWebApis()`, and choose a token cache implementation, for instance `.AddInMemoryTokenCaches()`
197+
If moreover you want your web API to call downstream web APIS, you'll need to add lines with `.AddProtectedWebApiCallsProtectedWebApi()`, and choose a token cache implementation, for instance `.AddInMemoryTokenCaches()`
198198

199199
```CSharp
200200
using Microsoft.Identity.Web;
@@ -206,7 +206,7 @@ public class Startup
206206
{
207207
...
208208
services.AddProtectedWebApi(Configuration)
209-
.AddProtectedApiCallsWebApis()
209+
.AddProtectedWebApiCallsProtectedWebApi()
210210
.AddInMemoryTokenCaches();
211211
...
212212
}
@@ -216,7 +216,7 @@ public class Startup
216216

217217
Like for Web Apps, you can choose various token cache implementations.
218218

219-
If you're certain that your web API will need some specific scopes, you can optionally pass them as arguments to `AddProtectedApiCallsWebApis`.
219+
If you're certain that your web API will need some specific scopes, you can optionally pass them as arguments to `AddProtectedWebApiCallsProtectedWebApi`.
220220

221221
### Web API controller
222222

@@ -275,7 +275,7 @@ Examples of possible distributed cache:
275275
```CSharp
276276
// or use a distributed Token Cache by adding
277277
services.AddSignIn(Configuration)
278-
.AddWebAppCallProtectedWebApi(new string[] { scopesToRequest })
278+
.AddWebAppCallsProtectedWebApi(new string[] { scopesToRequest })
279279
.AddDistributedTokenCaches();
280280

281281
// and then choose your implementation

Microsoft.Identity.Web/WebApiServiceCollectionExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public static IServiceCollection AddProtectedWebApi(
103103
/// <param name="services">Service collection to which to add authentication</param>
104104
/// <param name="configuration">Configuration</param>
105105
/// <returns></returns>
106-
public static IServiceCollection AddProtectedApiCallsWebApis(
106+
public static IServiceCollection AddProtectedWebApiCallsProtectedWebApi(
107107
this IServiceCollection services,
108108
IConfiguration configuration,
109109
string configSectionName = "AzureAd")

Microsoft.Identity.Web/WebAppServiceCollectionExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public static IServiceCollection AddSignIn(
111111
/// <param name="services">Service collection to which to add authentication</param>
112112
/// <param name="initialScopes">Initial scopes to request at sign-in</param>
113113
/// <returns></returns>
114-
public static IServiceCollection AddWebAppCallProtectedWebApi(this IServiceCollection services, IConfiguration configuration, IEnumerable<string> initialScopes, string configSectionName = "AzureAd")
114+
public static IServiceCollection AddWebAppCallsProtectedWebApi(this IServiceCollection services, IConfiguration configuration, IEnumerable<string> initialScopes, string configSectionName = "AzureAd")
115115
{
116116
// Ensure that configuration options for MSAL.NET, HttpContext accessor and the Token acquisition service
117117
// (encapsulating MSAL.NET) are available through dependency injection

0 commit comments

Comments
 (0)