-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for reading default scheme from config #41987
Add support for reading default scheme from config #41987
Conversation
src/Security/Authentication/Core/src/AuthenticationConfigureOptions.cs
Outdated
Show resolved
Hide resolved
src/Security/Authentication/Core/src/DefaultAuthenticationConfigurationProvider.cs
Outdated
Show resolved
Hide resolved
src/Security/Authentication/test/OpenIdConnect/OpenIdConnectConfigurationTests.cs
Outdated
Show resolved
Hide resolved
src/Http/Authentication.Abstractions/src/IAuthenticationConfigurationProvider.cs
Outdated
Show resolved
Hide resolved
76f82a3
to
f3d5d7c
Compare
src/Security/Authentication/Core/src/DefaultAuthenticationConfigurationProvider.cs
Outdated
Show resolved
Hide resolved
src/Security/Authentication/Core/src/AuthenticationConfigurationProviderExtensions.cs
Show resolved
Hide resolved
@@ -28,6 +29,8 @@ public static AuthenticationBuilder AddAuthentication(this IServiceCollection se | |||
services.AddWebEncoders(); | |||
services.TryAddSingleton<ISystemClock, SystemClock>(); | |||
services.TryAddSingleton<IAuthenticationConfigurationProvider, DefaultAuthenticationConfigurationProvider>(); | |||
services.TryAddEnumerable(ServiceDescriptor.Singleton<IConfigureOptions<AuthenticationOptions>, AuthenticationConfigureOptions>()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also discuss configuration changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah at a minimum we'd have to move away from IOptions and use IOptionsMonitor for AuthenticationOptions to be able to do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/Security/Authentication/Core/src/AuthenticationConfigurationProviderExtensions.cs
Show resolved
Hide resolved
@@ -510,4 +486,12 @@ public void AddAzureAD_SkipsOptionsValidationForNonAzureOpenIdConnect() | |||
|
|||
Assert.NotNull(openIdConnectOptions.Get("other")); | |||
} | |||
|
|||
private IServiceCollection GenerateServicesForTest() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
really nitty (don't feel obligated to do this): GenerateTestServices? But I'm not a huge fan of method names as sentences without spaces.
@@ -77,4 +79,12 @@ public static Task DescribeAsync(this HttpResponse res, IEnumerable<Authenticati | |||
return res.Body.WriteAsync(xmlBytes, 0, xmlBytes.Length); | |||
} | |||
|
|||
public static IServiceCollection ConfigureAuthTestServices(this IServiceCollection services) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: could drop Auth, ConfigureTestServices(), since this doesn't actually configure any auth services anyways.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe want to go with the same name between this one and GenerateServicesForTest for consistency too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll do this in another PR to avoid having to rekick the build again. 😓
😀 🐼 |
Hi @DamianEdwards. It looks like you just commented on a closed PR. The team will most probably miss it. If you'd like to bring something important up to their attention, consider filing a new issue and add enough details to build context. |
Part of #41956.
AuthenticationOptions.DefaultScheme
fromAuthentication:DefaultScheme
in configWebApplicationBuilder.Authentication
GetAuthenticationConfiguration
API toIAuthetnciationConfigurationProvider