Skip to content

Commit c596200

Browse files
authored
Merge pull request #371 from Azure-Samples/updateApi
API updates for 0.2.0-preview
2 parents be450af + 3a45878 commit c596200

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+233
-234
lines changed

1-WebApp-OIDC/1-1-MyOrg/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ cd "1-WebApp-OIDC\1-1-MyOrg"
163163
by this line:
164164
165165
```CSharp
166-
services.AddSignIn(Configuration);
166+
services.AddMicrosoftWebAppAuthentication(Configuration);
167167
```
168168
169169
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.

1-WebApp-OIDC/1-1-MyOrg/Startup.cs

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

3636
// Sign-in users with the Microsoft identity platform
37-
services.AddSignIn(Configuration);
37+
services.AddMicrosoftWebAppAuthentication(Configuration);
3838

3939
services.AddControllersWithViews(options =>
4040
{

1-WebApp-OIDC/1-1-MyOrg/WebApp-OpenIDConnect-DotNet.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2626
</PackageReference>
2727
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="3.0.0" />
28-
<PackageReference Include="Microsoft.Identity.Web" Version="0.1.5-preview" />
29-
<PackageReference Include="Microsoft.Identity.Web.UI" Version="0.1.5-preview" />
28+
<PackageReference Include="Microsoft.Identity.Web" Version="0.2.0-preview" />
29+
<PackageReference Include="Microsoft.Identity.Web.UI" Version="0.2.0-preview" />
3030
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.0.0" />
3131
</ItemGroup>
3232

1-WebApp-OIDC/1-2-AnyOrg/README-1-1-to-1-2.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@ The actual sign-in audience (accounts to sign-in) is the lowest set of what is s
5757

5858
In order to restrict users from specific organizations from signing-in to your web app, you'll need to customize your code a bit more to restrict issuers. In Azure AD, the token issuers are the Azure AD tenants which issue tokens to applications.
5959

60-
In the `Startup.cs` file, in the `ConfigureServices` method, after `services.AddSignIn(Configuration)` add some code to validate specific issuers by overriding the `TokenValidationParameters.IssuerValidator` delegate.
60+
In the `Startup.cs` file, in the `ConfigureServices` method, after `services.AddMicrosoftWebAppAuthentication(Configuration)` add some code to validate specific issuers by overriding the `TokenValidationParameters.IssuerValidator` delegate.
6161

6262
```CSharp
6363
public void ConfigureServices(IServiceCollection services)
6464
{
6565
...
6666
// Sign-in users with the Microsoft identity platform
67-
services.AddSignIn(Configuration, options =>
67+
services.AddMicrosoftWebAppAuthentication(Configuration, options =>
6868
{
6969
Configuration.Bind("AzureAd", options);
7070
// Restrict users to specific belonging to specific tenants

1-WebApp-OIDC/1-2-AnyOrg/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ cd "1-WebApp-OIDC\1-2-AnyOrg"
155155
by this line:
156156
157157
```CSharp
158-
services.AddSignIn(Configuration);
158+
services.AddMicrosoftWebAppAuthentication(Configuration);
159159
```
160160
161161
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.
@@ -221,14 +221,14 @@ These steps are encapsulated in the [Microsoft.Identity.Web](..\..\Microsoft.Ide
221221
222222
In order to restrict users from specific organizations from signing-in to your web app, you'll need to customize your code a bit more to restrict issuers. In Azure AD, the token issuers are the Azure AD tenants which issue tokens to applications.
223223

224-
In the `Startup.cs` file, in the `ConfigureServices` method, after `services.AddMicrosoftIdentityPlatformAuthentication(Configuration)` add some code to filter issuers by overriding the `TokenValidationParameters.IssuerValidator` delegate.
224+
In the `Startup.cs` file, in the `ConfigureServices` method, after `services.AddMicrosoftWebAppAuthentication(Configuration)` add some code to filter issuers by overriding the `TokenValidationParameters.IssuerValidator` delegate.
225225

226226
```CSharp
227227
public void ConfigureServices(IServiceCollection services)
228228
{
229229
...
230230
// Sign-in users with the Microsoft identity platform
231-
services.AddSignIn(Configuration);
231+
services.AddMicrosoftWebAppAuthentication(Configuration);
232232
233233
// Restrict users to specific belonging to specific tenants
234234
services.Configure<OpenIdConnectOptions>(OpenIdConnectDefaults.AuthenticationScheme, options =>

1-WebApp-OIDC/1-2-AnyOrg/Startup.cs

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

3636
// Sign-in users with the Microsoft identity platform
37-
services.AddSignIn(Configuration);
37+
services.AddMicrosoftWebAppAuthentication(Configuration);
3838

3939
services.AddControllersWithViews(options =>
4040
{

1-WebApp-OIDC/1-2-AnyOrg/WebApp-OpenIDConnect-DotNet.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
</ItemGroup>
1919

2020
<ItemGroup>
21-
<PackageReference Include="Microsoft.Identity.Web" Version="0.1.5-preview" />
22-
<PackageReference Include="Microsoft.Identity.Web.UI" Version="0.1.5-preview" />
21+
<PackageReference Include="Microsoft.Identity.Web" Version="0.2.0-preview" />
22+
<PackageReference Include="Microsoft.Identity.Web.UI" Version="0.2.0-preview" />
2323
</ItemGroup>
2424

2525
</Project>

1-WebApp-OIDC/1-3-AnyOrgOrPersonal/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,9 @@ In the **appsettings.json** file:
150150
by this line:
151151
152152
```CSharp
153-
services.AddSignIn(Configuration);
153+
154+
services.AddMicrosoftWebAppAuthentication(Configuration);
155+
154156
```
155157
156158
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.

1-WebApp-OIDC/1-3-AnyOrgOrPersonal/Startup.cs

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

3636
// Sign-in users with the Microsoft identity platform
37-
services.AddSignIn(Configuration);
37+
services.AddMicrosoftWebAppAuthentication(Configuration);
3838

3939
services.AddControllersWithViews(options =>
4040
{

1-WebApp-OIDC/1-3-AnyOrgOrPersonal/WebApp-OpenIDConnect-DotNet.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
</ItemGroup>
1919

2020
<ItemGroup>
21-
<PackageReference Include="Microsoft.Identity.Web" Version="0.1.5-preview" />
22-
<PackageReference Include="Microsoft.Identity.Web.UI" Version="0.1.5-preview" />
21+
<PackageReference Include="Microsoft.Identity.Web" Version="0.2.0-preview" />
22+
<PackageReference Include="Microsoft.Identity.Web.UI" Version="0.2.0-preview" />
2323
</ItemGroup>
2424

2525
</Project>

1-WebApp-OIDC/1-4-Sovereign/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ cd "1-WebApp-OIDC\1-4-Sovereign"
121121
by this line:
122122
123123
```CSharp
124-
services.AddSignIn(Configuration);
124+
services.AddMicrosoftWebAppAuthentication(Configuration);
125125
```
126126
127127
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.

1-WebApp-OIDC/1-4-Sovereign/Startup.cs

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

3636
// Sign-in users with the Microsoft identity platform
37-
services.AddSignIn(Configuration);
37+
services.AddMicrosoftWebAppAuthentication(Configuration);
3838

3939
services.AddControllersWithViews(options =>
4040
{

1-WebApp-OIDC/1-4-Sovereign/WebApp-OpenIDConnect-DotNet.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
</ItemGroup>
1919

2020
<ItemGroup>
21-
<PackageReference Include="Microsoft.Identity.Web" Version="0.1.5-preview" />
22-
<PackageReference Include="Microsoft.Identity.Web.UI" Version="0.1.5-preview" />
21+
<PackageReference Include="Microsoft.Identity.Web" Version="0.2.0-preview" />
22+
<PackageReference Include="Microsoft.Identity.Web.UI" Version="0.2.0-preview" />
2323
</ItemGroup>
2424

2525
</Project>

1-WebApp-OIDC/1-5-B2C/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,12 @@ You can trigger the middleware to send an OpenID Connect sign-in request by deco
125125
Here is the middleware example:
126126

127127
```csharp
128-
services.AddSignIn(Configuration, "AzureAdB2C");
128+
services.AddMicrosoftWebAppAuthentication(Configuration, "AzureAdB2C");
129129
```
130130

131131
Important things to notice:
132132

133-
- The method `AddSignIn` will configure the authentication based on the `MicrosoftIdentityOptions.cs` options. Feel free to bind more properties on `AzureAdB2C` section on `appsettings.json` if you need to set more options.
133+
- The method `AddMicrosoftWebAppAuthentication` will configure the authentication based on the `MicrosoftIdentityOptions.cs` options. Feel free to bind more properties on `AzureAdB2C` section on `appsettings.json` if you need to set more options.
134134
- The urls you set for `CallbackPath` and `SignedOutCallbackPath` should be registered on the **Reply Urls** of your application, in [Azure Portal](https://portal.azure.com).
135135

136136
## Next steps

1-WebApp-OIDC/1-5-B2C/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

3737
// Configuration to sign-in users with Azure AD B2C
38-
services.AddSignIn(Configuration, "AzureAdB2C");
38+
services.AddMicrosoftWebAppAuthentication(Configuration, "AzureAdB2C");
3939

4040
services.AddControllersWithViews()
4141
.AddMicrosoftIdentityUI();

1-WebApp-OIDC/1-5-B2C/WebApp-OpenIDConnect-DotNet.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
</ItemGroup>
1919

2020
<ItemGroup>
21-
<PackageReference Include="Microsoft.Identity.Web" Version="0.1.5-preview" />
22-
<PackageReference Include="Microsoft.Identity.Web.UI" Version="0.1.5-preview" />
21+
<PackageReference Include="Microsoft.Identity.Web" Version="0.2.0-preview" />
22+
<PackageReference Include="Microsoft.Identity.Web.UI" Version="0.2.0-preview" />
2323
</ItemGroup>
2424

2525
</Project>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ services.Configure<OpenIdConnectOptions>(OpenIdConnectDefaults.AuthenticationSch
6666

6767
### Clearing the token cache
6868

69-
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 [WebAppServiceCollectionExtensions.cs](https://github.com/AzureAD/microsoft-identity-web/blob/master/src/Microsoft.Identity.Web/WebAppServiceCollectionExtensions.cs#L202-L208)
69+
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 `AddMicrosoftWebAppCallsWebApi()` method of [WebAppServiceCollectionExtensions.cs](https://github.com/AzureAD/microsoft-identity-web/blob/master/src/Microsoft.Identity.Web/WebAppServiceCollectionExtensions.cs#L202-L208)
7070

7171
### Single Sign-Out
7272

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,9 @@ After the following lines in the ConfigureServices(IServiceCollection services)
100100
public void ConfigureServices(IServiceCollection services)
101101
{
102102
. . .
103-
services.AddSignIn(Configuration);
104-
// Token acquisition service based on MSAL.NET
105-
// and chosen token cache implementation
106-
services.AddWebAppCallsProtectedWebApi(Configuration, new string[] { Constants.ScopeUserRead })
107-
.AddInMemoryTokenCache();
103+
services.AddMicrosoftWebAppAuthentication(Configuration)
104+
.AddMicrosoftWebAppCallsWebApi(Configuration, new string[] { Constants.ScopeUserRead })
105+
.AddInMemoryTokenCaches();
108106
```
109107

110108
The two new lines of code:

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

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,13 @@ public void ConfigureServices(IServiceCollection services)
3939
});
4040

4141
services.AddOptions();
42-
43-
services.AddSignIn(Configuration);
44-
45-
// Token acquisition service based on MSAL.NET
46-
// and chosen token cache implementation
47-
services.AddWebAppCallsProtectedWebApi(Configuration, new string[] { Constants.ScopeUserRead })
48-
.AddInMemoryTokenCaches();
4942

43+
services.AddMicrosoftWebAppAuthentication(Configuration)
44+
.AddMicrosoftWebAppCallsWebApi(Configuration, new string[] { Constants.ScopeUserRead })
45+
.AddInMemoryTokenCaches();
5046
/*
5147
// or use a distributed Token Cache by adding
52-
.AddDistributedTokenCaches();
48+
.AddDistributedTokenCaches();
5349
5450
// and then choose your implementation.
5551
// See https://docs.microsoft.com/en-us/aspnet/core/performance/caching/distributed?view=aspnetcore-2.2#distributed-memory-cache
@@ -111,11 +107,11 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
111107

112108
app.UseEndpoints(endpoints =>
113109
{
114-
endpoints.MapControllerRoute(
115-
name: "default",
116-
pattern: "{controller=Home}/{action=Index}/{id?}");
117-
endpoints.MapRazorPages();
118-
});
110+
endpoints.MapControllerRoute(
111+
name: "default",
112+
pattern: "{controller=Home}/{action=Index}/{id?}");
113+
endpoints.MapRazorPages();
114+
});
119115
}
120116
}
121117
}

2-WebApp-graph-user/2-1-Call-MSGraph/WebApp-OpenIDConnect-DotNet.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919

2020
<ItemGroup>
2121
<PackageReference Include="Microsoft.Graph" Version="1.21.0" />
22-
<PackageReference Include="Microsoft.Identity.Web" Version="0.1.5-preview" />
23-
<PackageReference Include="Microsoft.Identity.Web.UI" Version="0.1.5-preview" />
22+
<PackageReference Include="Microsoft.Identity.Web" Version="0.2.0-preview" />
23+
<PackageReference Include="Microsoft.Identity.Web.UI" Version="0.2.0-preview" />
2424
</ItemGroup>
2525

2626
</Project>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"dependencies": {
3+
"secrets1": {
4+
"type": "secrets"
5+
}
6+
}
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"dependencies": {
3+
"secrets1": {
4+
"type": "secrets.user"
5+
}
6+
}
7+
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ public void ConfigureServices(IServiceCollection services)
9696
. . .
9797
// Token acquisition service based on MSAL.NET
9898
// and the Sql server based token cache implementation
99-
services.AddMicrosoftIdentityPlatformAuthentication(Configuration)
100-
.AddWebAppCallsProtectedWebApi(new string[] { Constants.ScopeUserRead })
99+
services.AddMicrosoftWebAppAuthentication(Configuration)
100+
.AddMicrosoftWebAppCallsWebApi(new string[] { Constants.ScopeUserRead })
101101
.AddSqlAppTokenCache(Configuration)
102102
.AddSqlPerUserTokenCache(Configuration);
103103
```

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,10 @@ This sample proposes a distributed SQL token cache. To use it, you'll need to ad
185185
public void ConfigureServices(IServiceCollection services)
186186
{
187187
. . .
188-
// Token acquisition service based on MSAL.NET
189-
// and the Sql server based token cache implementation
190-
services.AddSignIn(Configuration)
191-
.AddWebAppCallsProtectedWebApi(Configuration, new string[] { Constants.ScopeUserRead })
192-
.AddDistributedTokenCaches();
188+
services.AddAuthentication(OpenIdConnectDefaults.AuthenticationScheme)
189+
.AddMicrosoftWebApp(Configuration)
190+
.AddMicrosoftWebAppCallsWebApi(Configuration, new string[] { Constants.ScopeUserRead })
191+
.AddDistributedTokenCaches();
193192

194193
services.AddDistributedSqlServerCache(options =>
195194
{

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

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,17 @@ public void ConfigureServices(IServiceCollection services)
4747
// NOTE : This is a one time use method. We advise using it in development environments to create the tables required to enable token caching.
4848
// For production deployments, preferably, generate the schema from the tables generated in dev environments and use it to create the necessary tables in production.
4949
/*
50-
dotnet tool install --global dotnet-sql-cache
51-
dotnet sql-cache create "Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=MsalTokenCacheDatabase;Integrated Security=True;" dbo TokenCache
50+
* 1. For instance in Visual Studio, open the SQL Server Object explorer, then (localdb)\MSSQLLocalDB, then databases
51+
* 2. Right click on Databases and select "Add New database", and then choose the name of the database: 'MsalTokenCacheDatabase'
52+
* 3. In the console application run the 2 following commands:
53+
dotnet tool install --global dotnet-sql-cache
54+
dotnet sql-cache create "Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=MsalTokenCacheDatabase;Integrated Security=True;" dbo TokenCache
5255
*/
5356

54-
services.AddSignIn(Configuration);
55-
56-
// Token acquisition service based on MSAL.NET
57-
// and chosen token cache implementation
58-
services.AddWebAppCallsProtectedWebApi(Configuration, new string[] { Constants.ScopeUserRead })
59-
.AddDistributedTokenCaches();
57+
services.AddAuthentication(OpenIdConnectDefaults.AuthenticationScheme)
58+
.AddMicrosoftWebApp(Configuration)
59+
.AddMicrosoftWebAppCallsWebApi(Configuration, new string[] { Constants.ScopeUserRead })
60+
.AddDistributedTokenCaches();
6061

6162
services.AddDistributedSqlServerCache(options =>
6263
{

2-WebApp-graph-user/2-2-TokenCache/WebApp-OpenIDConnect-DotNet.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
<ItemGroup>
2121
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.0.1" />
2222
<PackageReference Include="Microsoft.Extensions.Caching.SqlServer" Version="3.0.1" />
23-
<PackageReference Include="Microsoft.Identity.Web" Version="0.1.5-preview" />
24-
<PackageReference Include="Microsoft.Identity.Web.UI" Version="0.1.5-preview" />
23+
<PackageReference Include="Microsoft.Identity.Web" Version="0.2.0-preview" />
24+
<PackageReference Include="Microsoft.Identity.Web.UI" Version="0.2.0-preview" />
2525
</ItemGroup>
2626

2727
</Project>

2-WebApp-graph-user/2-3-Multi-Tenant/README-National-Cloud.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ The `https://graph.microsoft.com/.default` is a static scope that allows the ten
273273

274274
### Custom token validation allowing only registered tenants
275275

276-
On the `Startup.cs` we are calling `AddSignIn` to configure the authentication, and within that method, we validates that the token issuer is from AAD.
276+
On the `Startup.cs` we are calling `AddMicrosoftWebAppAuthentication` to configure the authentication, and within that method, we validates that the token issuer is from AAD.
277277

278278
```csharp
279279
options.TokenValidationParameters.IssuerValidator = AadIssuerValidator.GetIssuerValidator(options.Authority).Validate;

2-WebApp-graph-user/2-3-Multi-Tenant/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,8 @@ These steps are encapsulated in the [Microsoft.Identity.Web](..\..\Microsoft.Ide
212212
In order to be able to sign-in users from multiple tenants, the [/common endpoint](https://docs.microsoft.com/azure/active-directory/develop/howto-convert-app-to-be-multi-tenant#update-your-code-to-send-requests-to-common) must be used. In the sample, this endpoint is used as a result of setting the value for `TenantId` as `organizations` on the `appsettings.json` file, and configuring the middleware to read the values from it.
213213

214214
```csharp
215-
services.AddSignIn(Configuration);
215+
services.AddAuthentication(OpenIdConnectDefaults.AuthenticationScheme)
216+
.AddMicrosoftWebApp(Configuration)
216217
```
217218

218219
You can read about the various endpoints of the Microsoft Identity Platform [here](https://docs.microsoft.com/azure/active-directory/develop/active-directory-v2-protocols#endpoints).
@@ -248,7 +249,7 @@ The `https://graph.microsoft.com/.default` is a static scope that allows the ten
248249

249250
### Custom token validation allowing only registered tenants
250251

251-
On the `Startup.cs` we are calling `AddSignIn` to configure the authentication, and within that method, we validates that the token issuer is from AAD.
252+
On the `Startup.cs` we are calling `AddMicrosoftWebAppAuthentication` to configure the authentication, and within that method, we validates that the token issuer is from AAD.
252253

253254
```csharp
254255
options.TokenValidationParameters.IssuerValidator = AadIssuerValidator.GetIssuerValidator(options.Authority).Validate;

0 commit comments

Comments
 (0)