Skip to content

Commit 23c528c

Browse files
committed
[Azure] [Fixes #6033, #6580, #6669] Various fixes and cleanups.
* Adds an Azure AD Sample and adds a page to test access denied. * Renames AzureAD and AzureADB2C internal classes for easier to debug stacktraces. * Fixes service registration for options configuration. * Adds missing deps to the solution.
1 parent a3e0a45 commit 23c528c

File tree

66 files changed

+23688
-36
lines changed

Some content is hidden

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

66 files changed

+23688
-36
lines changed

src/Azure/Azure.sln

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Authen
7979
EndProject
8080
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Authentication", "..\Security\Authentication\Core\src\Microsoft.AspNetCore.Authentication.csproj", "{A5E7BA46-B76B-467A-88FA-38E04D0A42FC}"
8181
EndProject
82+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AzureADSample", "AzureAD\samples\AzureADSample\AzureADSample.csproj", "{8B083F30-7199-4BE1-97B0-2C57FE0C25E9}"
83+
EndProject
84+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Authentication.Cookies", "..\Security\Authentication\Cookies\src\Microsoft.AspNetCore.Authentication.Cookies.csproj", "{58BAE6BE-7BEB-4C1B-8863-5BF51D4134BD}"
85+
EndProject
86+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Authentication.JwtBearer", "..\Security\Authentication\JwtBearer\src\Microsoft.AspNetCore.Authentication.JwtBearer.csproj", "{B2499B17-5D03-4A5B-9AD1-DBFE7C4B08DF}"
87+
EndProject
8288
Global
8389
GlobalSection(SolutionConfigurationPlatforms) = preSolution
8490
Debug|Any CPU = Debug|Any CPU
@@ -425,6 +431,42 @@ Global
425431
{A5E7BA46-B76B-467A-88FA-38E04D0A42FC}.Release|x64.Build.0 = Release|Any CPU
426432
{A5E7BA46-B76B-467A-88FA-38E04D0A42FC}.Release|x86.ActiveCfg = Release|Any CPU
427433
{A5E7BA46-B76B-467A-88FA-38E04D0A42FC}.Release|x86.Build.0 = Release|Any CPU
434+
{8B083F30-7199-4BE1-97B0-2C57FE0C25E9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
435+
{8B083F30-7199-4BE1-97B0-2C57FE0C25E9}.Debug|Any CPU.Build.0 = Debug|Any CPU
436+
{8B083F30-7199-4BE1-97B0-2C57FE0C25E9}.Debug|x64.ActiveCfg = Debug|Any CPU
437+
{8B083F30-7199-4BE1-97B0-2C57FE0C25E9}.Debug|x64.Build.0 = Debug|Any CPU
438+
{8B083F30-7199-4BE1-97B0-2C57FE0C25E9}.Debug|x86.ActiveCfg = Debug|Any CPU
439+
{8B083F30-7199-4BE1-97B0-2C57FE0C25E9}.Debug|x86.Build.0 = Debug|Any CPU
440+
{8B083F30-7199-4BE1-97B0-2C57FE0C25E9}.Release|Any CPU.ActiveCfg = Release|Any CPU
441+
{8B083F30-7199-4BE1-97B0-2C57FE0C25E9}.Release|Any CPU.Build.0 = Release|Any CPU
442+
{8B083F30-7199-4BE1-97B0-2C57FE0C25E9}.Release|x64.ActiveCfg = Release|Any CPU
443+
{8B083F30-7199-4BE1-97B0-2C57FE0C25E9}.Release|x64.Build.0 = Release|Any CPU
444+
{8B083F30-7199-4BE1-97B0-2C57FE0C25E9}.Release|x86.ActiveCfg = Release|Any CPU
445+
{8B083F30-7199-4BE1-97B0-2C57FE0C25E9}.Release|x86.Build.0 = Release|Any CPU
446+
{58BAE6BE-7BEB-4C1B-8863-5BF51D4134BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
447+
{58BAE6BE-7BEB-4C1B-8863-5BF51D4134BD}.Debug|Any CPU.Build.0 = Debug|Any CPU
448+
{58BAE6BE-7BEB-4C1B-8863-5BF51D4134BD}.Debug|x64.ActiveCfg = Debug|Any CPU
449+
{58BAE6BE-7BEB-4C1B-8863-5BF51D4134BD}.Debug|x64.Build.0 = Debug|Any CPU
450+
{58BAE6BE-7BEB-4C1B-8863-5BF51D4134BD}.Debug|x86.ActiveCfg = Debug|Any CPU
451+
{58BAE6BE-7BEB-4C1B-8863-5BF51D4134BD}.Debug|x86.Build.0 = Debug|Any CPU
452+
{58BAE6BE-7BEB-4C1B-8863-5BF51D4134BD}.Release|Any CPU.ActiveCfg = Release|Any CPU
453+
{58BAE6BE-7BEB-4C1B-8863-5BF51D4134BD}.Release|Any CPU.Build.0 = Release|Any CPU
454+
{58BAE6BE-7BEB-4C1B-8863-5BF51D4134BD}.Release|x64.ActiveCfg = Release|Any CPU
455+
{58BAE6BE-7BEB-4C1B-8863-5BF51D4134BD}.Release|x64.Build.0 = Release|Any CPU
456+
{58BAE6BE-7BEB-4C1B-8863-5BF51D4134BD}.Release|x86.ActiveCfg = Release|Any CPU
457+
{58BAE6BE-7BEB-4C1B-8863-5BF51D4134BD}.Release|x86.Build.0 = Release|Any CPU
458+
{B2499B17-5D03-4A5B-9AD1-DBFE7C4B08DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
459+
{B2499B17-5D03-4A5B-9AD1-DBFE7C4B08DF}.Debug|Any CPU.Build.0 = Debug|Any CPU
460+
{B2499B17-5D03-4A5B-9AD1-DBFE7C4B08DF}.Debug|x64.ActiveCfg = Debug|Any CPU
461+
{B2499B17-5D03-4A5B-9AD1-DBFE7C4B08DF}.Debug|x64.Build.0 = Debug|Any CPU
462+
{B2499B17-5D03-4A5B-9AD1-DBFE7C4B08DF}.Debug|x86.ActiveCfg = Debug|Any CPU
463+
{B2499B17-5D03-4A5B-9AD1-DBFE7C4B08DF}.Debug|x86.Build.0 = Debug|Any CPU
464+
{B2499B17-5D03-4A5B-9AD1-DBFE7C4B08DF}.Release|Any CPU.ActiveCfg = Release|Any CPU
465+
{B2499B17-5D03-4A5B-9AD1-DBFE7C4B08DF}.Release|Any CPU.Build.0 = Release|Any CPU
466+
{B2499B17-5D03-4A5B-9AD1-DBFE7C4B08DF}.Release|x64.ActiveCfg = Release|Any CPU
467+
{B2499B17-5D03-4A5B-9AD1-DBFE7C4B08DF}.Release|x64.Build.0 = Release|Any CPU
468+
{B2499B17-5D03-4A5B-9AD1-DBFE7C4B08DF}.Release|x86.ActiveCfg = Release|Any CPU
469+
{B2499B17-5D03-4A5B-9AD1-DBFE7C4B08DF}.Release|x86.Build.0 = Release|Any CPU
428470
EndGlobalSection
429471
GlobalSection(SolutionProperties) = preSolution
430472
HideSolutionNode = FALSE
@@ -463,6 +505,9 @@ Global
463505
{F44054A2-DAC9-467F-B899-F35F9DCDAE9C} = {84622717-F98A-4DE2-806E-1EF89C45C0EB}
464506
{406DF28A-0B58-408E-96B0-2D373EE36352} = {84622717-F98A-4DE2-806E-1EF89C45C0EB}
465507
{A5E7BA46-B76B-467A-88FA-38E04D0A42FC} = {84622717-F98A-4DE2-806E-1EF89C45C0EB}
508+
{8B083F30-7199-4BE1-97B0-2C57FE0C25E9} = {A28A64CA-297E-4023-895A-483DFDA59FBE}
509+
{58BAE6BE-7BEB-4C1B-8863-5BF51D4134BD} = {84622717-F98A-4DE2-806E-1EF89C45C0EB}
510+
{B2499B17-5D03-4A5B-9AD1-DBFE7C4B08DF} = {84622717-F98A-4DE2-806E-1EF89C45C0EB}
466511
EndGlobalSection
467512
GlobalSection(ExtensibilityGlobals) = postSolution
468513
SolutionGuid = {81AADD49-473B-43ED-8A08-F6B7A058AA39}

src/Azure/AzureAD/Authentication.AzureAD.UI/src/AzureADAuthenticationBuilderExtensions.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ public static AuthenticationBuilder AddAzureADBearer(
5858

5959
builder.Services.Configure(TryAddJwtBearerSchemeMapping(scheme, jwtBearerScheme));
6060

61-
builder.Services.TryAddSingleton<IConfigureOptions<AzureADOptions>, AzureADOptionsConfiguration>();
61+
builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IConfigureOptions<AzureADOptions>, AzureADOptionsConfiguration>());
6262

63-
builder.Services.TryAddSingleton<IConfigureOptions<JwtBearerOptions>, JwtBearerOptionsConfiguration>();
63+
builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IConfigureOptions<JwtBearerOptions>, AzureADJwtBearerOptionsConfiguration>());
6464

6565
builder.Services.Configure(scheme, configureOptions);
6666
builder.AddJwtBearer(jwtBearerScheme, o => { });
@@ -113,11 +113,11 @@ public static AuthenticationBuilder AddAzureAD(
113113

114114
builder.Services.Configure(TryAddOpenIDCookieSchemeMappings(scheme, openIdConnectScheme, cookieScheme));
115115

116-
builder.Services.TryAddSingleton<IConfigureOptions<AzureADOptions>, AzureADOptionsConfiguration>();
116+
builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IConfigureOptions<AzureADOptions>, AzureADOptionsConfiguration>());
117117

118-
builder.Services.TryAddSingleton<IConfigureOptions<OpenIdConnectOptions>, OpenIdConnectOptionsConfiguration>();
118+
builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IConfigureOptions<OpenIdConnectOptions>, AzureADOpenIdConnectOptionsConfiguration>());
119119

120-
builder.Services.TryAddSingleton<IConfigureOptions<CookieAuthenticationOptions>, CookieOptionsConfiguration>();
120+
builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IConfigureOptions<CookieAuthenticationOptions>, AzureADCookieOptionsConfiguration>());
121121

122122
builder.Services.Configure(scheme, configureOptions);
123123

src/Azure/AzureAD/Authentication.AzureAD.UI/src/CookieOptionsConfiguration.cs renamed to src/Azure/AzureAD/Authentication.AzureAD.UI/src/AzureADCookieOptionsConfiguration.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66

77
namespace Microsoft.AspNetCore.Authentication.AzureAD.UI
88
{
9-
internal class CookieOptionsConfiguration : IConfigureNamedOptions<CookieAuthenticationOptions>
9+
internal class AzureADCookieOptionsConfiguration : IConfigureNamedOptions<CookieAuthenticationOptions>
1010
{
1111
private readonly IOptions<AzureADSchemeOptions> _schemeOptions;
1212
private readonly IOptionsMonitor<AzureADOptions> _AzureADOptions;
1313

14-
public CookieOptionsConfiguration(IOptions<AzureADSchemeOptions> schemeOptions, IOptionsMonitor<AzureADOptions> AzureADOptions)
14+
public AzureADCookieOptionsConfiguration(IOptions<AzureADSchemeOptions> schemeOptions, IOptionsMonitor<AzureADOptions> AzureADOptions)
1515
{
1616
_schemeOptions = schemeOptions;
1717
_AzureADOptions = AzureADOptions;

src/Azure/AzureAD/Authentication.AzureAD.UI/src/JwtBearerOptionsConfiguration.cs renamed to src/Azure/AzureAD/Authentication.AzureAD.UI/src/AzureADJwtBearerOptionsConfiguration.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) .NET Foundation. All rights reserved.
1+
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.using Microsoft.AspNetCore.Authorization;
33

44
using System;
@@ -8,12 +8,12 @@
88

99
namespace Microsoft.AspNetCore.Authentication
1010
{
11-
internal class JwtBearerOptionsConfiguration : IConfigureNamedOptions<JwtBearerOptions>
11+
internal class AzureADJwtBearerOptionsConfiguration : IConfigureNamedOptions<JwtBearerOptions>
1212
{
1313
private readonly IOptions<AzureADSchemeOptions> _schemeOptions;
1414
private readonly IOptionsMonitor<AzureADOptions> _azureADOptions;
1515

16-
public JwtBearerOptionsConfiguration(
16+
public AzureADJwtBearerOptionsConfiguration(
1717
IOptions<AzureADSchemeOptions> schemeOptions,
1818
IOptionsMonitor<AzureADOptions> azureADOptions)
1919
{

src/Azure/AzureAD/Authentication.AzureAD.UI/src/OpenIdConnectOptionsConfiguration.cs renamed to src/Azure/AzureAD/Authentication.AzureAD.UI/src/AzureADOpenIdConnectOptionsConfiguration.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) .NET Foundation. All rights reserved.
1+
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.using Microsoft.AspNetCore.Authorization;
33

44
using System;
@@ -7,12 +7,12 @@
77

88
namespace Microsoft.AspNetCore.Authentication.AzureAD.UI
99
{
10-
internal class OpenIdConnectOptionsConfiguration : IConfigureNamedOptions<OpenIdConnectOptions>
10+
internal class AzureADOpenIdConnectOptionsConfiguration : IConfigureNamedOptions<OpenIdConnectOptions>
1111
{
1212
private readonly IOptions<AzureADSchemeOptions> _schemeOptions;
1313
private readonly IOptionsMonitor<AzureADOptions> _azureADOptions;
1414

15-
public OpenIdConnectOptionsConfiguration(IOptions<AzureADSchemeOptions> schemeOptions, IOptionsMonitor<AzureADOptions> azureADOptions)
15+
public AzureADOpenIdConnectOptionsConfiguration(IOptions<AzureADSchemeOptions> schemeOptions, IOptionsMonitor<AzureADOptions> azureADOptions)
1616
{
1717
_schemeOptions = schemeOptions;
1818
_azureADOptions = azureADOptions;

src/Azure/AzureAD/Authentication.AzureAD.UI/test/AzureADAuthenticationBuilderExtensionsTests.cs

Lines changed: 160 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) .NET Foundation. All rights reserved.
1+
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.using Microsoft.AspNetCore.Authorization;
33

44
using System;
@@ -76,6 +76,98 @@ public void AddAzureAD_ConfiguresAllOptions()
7676
Assert.Equal(AzureADDefaults.CookieScheme, openIdOptions.SignInScheme);
7777
}
7878

79+
[Fact]
80+
public void AddAzureAD_AllowsOverridingCookiesAndOpenIdConnectSettings()
81+
{
82+
// Arrange
83+
var services = new ServiceCollection();
84+
services.AddSingleton<ILoggerFactory>(new NullLoggerFactory());
85+
86+
// Act
87+
services.AddAuthentication()
88+
.AddAzureAD(o =>
89+
{
90+
o.Instance = "https://login.microsoftonline.com";
91+
o.ClientId = "ClientId";
92+
o.ClientSecret = "ClientSecret";
93+
o.CallbackPath = "/signin-oidc";
94+
o.Domain = "domain.onmicrosoft.com";
95+
o.TenantId = "Common";
96+
});
97+
98+
services.Configure<OpenIdConnectOptions>(AzureADDefaults.OpenIdScheme, o =>
99+
{
100+
o.Authority = "https://overriden.com";
101+
});
102+
103+
services.Configure<CookieAuthenticationOptions>(AzureADDefaults.CookieScheme, o =>
104+
{
105+
o.AccessDeniedPath = "/Overriden";
106+
});
107+
108+
var provider = services.BuildServiceProvider();
109+
110+
// Assert
111+
var openIdOptionsMonitor = provider.GetService<IOptionsMonitor<OpenIdConnectOptions>>();
112+
Assert.NotNull(openIdOptionsMonitor);
113+
var openIdOptions = openIdOptionsMonitor.Get(AzureADDefaults.OpenIdScheme);
114+
Assert.Equal("ClientId", openIdOptions.ClientId);
115+
Assert.Equal($"https://overriden.com", openIdOptions.Authority);
116+
117+
var cookieAuthenticationOptionsMonitor = provider.GetService<IOptionsMonitor<CookieAuthenticationOptions>>();
118+
Assert.NotNull(cookieAuthenticationOptionsMonitor);
119+
var cookieAuthenticationOptions = cookieAuthenticationOptionsMonitor.Get(AzureADDefaults.CookieScheme);
120+
Assert.Equal("/AzureAD/Account/SignIn/AzureAD", cookieAuthenticationOptions.LoginPath);
121+
Assert.Equal("/Overriden", cookieAuthenticationOptions.AccessDeniedPath);
122+
}
123+
124+
[Fact]
125+
public void AddAzureAD_RegisteringAddCookiesAndAddOpenIdConnectHasNoImpactOnAzureAAExtensions()
126+
{
127+
// Arrange
128+
var services = new ServiceCollection();
129+
services.AddSingleton<ILoggerFactory>(new NullLoggerFactory());
130+
131+
// Act
132+
services.AddAuthentication()
133+
.AddOpenIdConnect()
134+
.AddCookie()
135+
.AddAzureAD(o =>
136+
{
137+
o.Instance = "https://login.microsoftonline.com";
138+
o.ClientId = "ClientId";
139+
o.ClientSecret = "ClientSecret";
140+
o.CallbackPath = "/signin-oidc";
141+
o.Domain = "domain.onmicrosoft.com";
142+
o.TenantId = "Common";
143+
});
144+
145+
services.Configure<OpenIdConnectOptions>(AzureADDefaults.OpenIdScheme, o =>
146+
{
147+
o.Authority = "https://overriden.com";
148+
});
149+
150+
services.Configure<CookieAuthenticationOptions>(AzureADDefaults.CookieScheme, o =>
151+
{
152+
o.AccessDeniedPath = "/Overriden";
153+
});
154+
155+
var provider = services.BuildServiceProvider();
156+
157+
// Assert
158+
var openIdOptionsMonitor = provider.GetService<IOptionsMonitor<OpenIdConnectOptions>>();
159+
Assert.NotNull(openIdOptionsMonitor);
160+
var openIdOptions = openIdOptionsMonitor.Get(AzureADDefaults.OpenIdScheme);
161+
Assert.Equal("ClientId", openIdOptions.ClientId);
162+
Assert.Equal($"https://overriden.com", openIdOptions.Authority);
163+
164+
var cookieAuthenticationOptionsMonitor = provider.GetService<IOptionsMonitor<CookieAuthenticationOptions>>();
165+
Assert.NotNull(cookieAuthenticationOptionsMonitor);
166+
var cookieAuthenticationOptions = cookieAuthenticationOptionsMonitor.Get(AzureADDefaults.CookieScheme);
167+
Assert.Equal("/AzureAD/Account/SignIn/AzureAD", cookieAuthenticationOptions.LoginPath);
168+
Assert.Equal("/Overriden", cookieAuthenticationOptions.AccessDeniedPath);
169+
}
170+
79171
[Fact]
80172
public void AddAzureAD_ThrowsForDuplicatedSchemes()
81173
{
@@ -197,6 +289,73 @@ public void AddAzureADBearer_ConfiguresAllOptions()
197289
Assert.Equal($"https://login.microsoftonline.com/TenantId", bearerOptions.Authority);
198290
}
199291

292+
[Fact]
293+
public void AddAzureADBearer_CanOverrideJwtBearerOptionsConfiguration()
294+
{
295+
// Arrange
296+
var services = new ServiceCollection();
297+
services.AddSingleton<ILoggerFactory>(new NullLoggerFactory());
298+
299+
// Act
300+
services.AddAuthentication()
301+
.AddAzureADBearer(o =>
302+
{
303+
o.Instance = "https://login.microsoftonline.com/";
304+
o.ClientId = "ClientId";
305+
o.CallbackPath = "/signin-oidc";
306+
o.Domain = "domain.onmicrosoft.com";
307+
o.TenantId = "TenantId";
308+
});
309+
310+
services.Configure<JwtBearerOptions>(AzureADDefaults.JwtBearerAuthenticationScheme, o =>
311+
{
312+
o.Audience = "http://overriden.com";
313+
});
314+
315+
var provider = services.BuildServiceProvider();
316+
317+
// Assert
318+
var bearerOptionsMonitor = provider.GetService<IOptionsMonitor<JwtBearerOptions>>();
319+
Assert.NotNull(bearerOptionsMonitor);
320+
var bearerOptions = bearerOptionsMonitor.Get(AzureADDefaults.JwtBearerAuthenticationScheme);
321+
Assert.Equal("http://overriden.com", bearerOptions.Audience);
322+
Assert.Equal($"https://login.microsoftonline.com/TenantId", bearerOptions.Authority);
323+
}
324+
325+
[Fact]
326+
public void AddAzureADBearer_RegisteringJwtBearerHasNoImpactOnAzureAAExtensions()
327+
{
328+
// Arrange
329+
var services = new ServiceCollection();
330+
services.AddSingleton<ILoggerFactory>(new NullLoggerFactory());
331+
332+
// Act
333+
services.AddAuthentication()
334+
.AddJwtBearer()
335+
.AddAzureADBearer(o =>
336+
{
337+
o.Instance = "https://login.microsoftonline.com/";
338+
o.ClientId = "ClientId";
339+
o.CallbackPath = "/signin-oidc";
340+
o.Domain = "domain.onmicrosoft.com";
341+
o.TenantId = "TenantId";
342+
});
343+
344+
services.Configure<JwtBearerOptions>(AzureADDefaults.JwtBearerAuthenticationScheme, o =>
345+
{
346+
o.Audience = "http://overriden.com";
347+
});
348+
349+
var provider = services.BuildServiceProvider();
350+
351+
// Assert
352+
var bearerOptionsMonitor = provider.GetService<IOptionsMonitor<JwtBearerOptions>>();
353+
Assert.NotNull(bearerOptionsMonitor);
354+
var bearerOptions = bearerOptionsMonitor.Get(AzureADDefaults.JwtBearerAuthenticationScheme);
355+
Assert.Equal("http://overriden.com", bearerOptions.Audience);
356+
Assert.Equal($"https://login.microsoftonline.com/TenantId", bearerOptions.Authority);
357+
}
358+
200359
[Fact]
201360
public void AddAzureADBearer_ThrowsForDuplicatedSchemes()
202361
{

src/Azure/AzureAD/Authentication.AzureADB2C.UI/src/CookieOptionsConfiguration.cs renamed to src/Azure/AzureAD/Authentication.AzureADB2C.UI/src/AzureADB2CCookieOptionsConfiguration.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66

77
namespace Microsoft.AspNetCore.Authentication.AzureADB2C.UI
88
{
9-
internal class CookieOptionsConfiguration : IConfigureNamedOptions<CookieAuthenticationOptions>
9+
internal class AzureADB2CCookieOptionsConfiguration : IConfigureNamedOptions<CookieAuthenticationOptions>
1010
{
1111
private readonly IOptions<AzureADB2CSchemeOptions> _schemeOptions;
1212
private readonly IOptionsMonitor<AzureADB2COptions> _azureADB2COptions;
1313

14-
public CookieOptionsConfiguration(IOptions<AzureADB2CSchemeOptions> schemeOptions, IOptionsMonitor<AzureADB2COptions> azureADB2COptions)
14+
public AzureADB2CCookieOptionsConfiguration(IOptions<AzureADB2CSchemeOptions> schemeOptions, IOptionsMonitor<AzureADB2COptions> azureADB2COptions)
1515
{
1616
_schemeOptions = schemeOptions;
1717
_azureADB2COptions = azureADB2COptions;

src/Azure/AzureAD/Authentication.AzureADB2C.UI/src/JwtBearerOptionsConfiguration.cs renamed to src/Azure/AzureAD/Authentication.AzureADB2C.UI/src/AzureADB2CJwtBearerOptionsConfiguration.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) .NET Foundation. All rights reserved.
1+
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.using Microsoft.AspNetCore.Authorization;
33

44
using Microsoft.AspNetCore.Authentication.JwtBearer;
@@ -7,12 +7,12 @@
77

88
namespace Microsoft.AspNetCore.Authentication
99
{
10-
internal class JwtBearerOptionsConfiguration : IConfigureNamedOptions<JwtBearerOptions>
10+
internal class AzureADB2CJwtBearerOptionsConfiguration : IConfigureNamedOptions<JwtBearerOptions>
1111
{
1212
private readonly IOptions<AzureADB2CSchemeOptions> _schemeOptions;
1313
private readonly IOptionsMonitor<AzureADB2COptions> _azureADB2COptions;
1414

15-
public JwtBearerOptionsConfiguration(
15+
public AzureADB2CJwtBearerOptionsConfiguration(
1616
IOptions<AzureADB2CSchemeOptions> schemeOptions,
1717
IOptionsMonitor<AzureADB2COptions> azureADB2COptions)
1818
{
@@ -30,7 +30,7 @@ public void Configure(string name, JwtBearerOptions options)
3030
}
3131

3232
options.Audience = azureADB2COptions.ClientId;
33-
options.Authority = OpenIdConnectOptionsConfiguration.BuildAuthority(azureADB2COptions);
33+
options.Authority = AzureADB2COpenIdConnectOptionsConfiguration.BuildAuthority(azureADB2COptions);
3434
}
3535

3636
public void Configure(JwtBearerOptions options)

0 commit comments

Comments
 (0)