-
Notifications
You must be signed in to change notification settings - Fork 58
Conversation
@@ -15,13 +17,14 @@ public void ConfigureServices(IServiceCollection services) | |||
// These two middleware are registered via an IStartupFilter in UseIISIntegration but you can configure them here. | |||
services.Configure<IISOptions>(options => | |||
{ | |||
options.AuthenticationDisplayName = "Windows Auth"; |
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.
Should just default this to the scheme like everything else to be consistent: IISDefaults.AuthenticationScheme. We don't suffix anything else with Auth today
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.
Not sure about that. Do you want the Windows scheme to be included by default in the "providers list"?
Pretty sure this has already been discussed in the past.
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, it's null to avoid showing up by default. This is just the sample.
@Tratcher thanks! Did you consider directly exposing Something like: public AuthenticationSchemeBuilder Scheme { get; } = new AuthenticationSchemeBuilder
{
HandlerType = typeof(AuthenticationHandler),
Name = IISDefaults.AuthenticationScheme
}; services.Configure<IISOptions>(options =>
{
options.Scheme.DisplayName = "Intranet";
}); |
That seems more dangerous, I don't think we want to allow people to change the HandlerType at all |
That's interesting, bug I agree exposing the handler would be problematic. |
I don't think making the scheme name configurable is that critical, but if we want to expose that as well, its harmless and matches what Security auth does |
Well, if that's your only concern, you still can add a check to ensure the type wasn't changed before calling if (!typeof(AuthenticationHandler).IsAssignableFrom(_options.Scheme.HandlerType))
{
throw new InvalidOperationException("You're doing something wrong, bro'.");
} |
That just seems like a more error prone alternative to exposing only AuthenticationScheme / DisplayName |
The structure would be nice.. |
Sure. But that was a clever way to save one property while adopting the same pattern as the one you've used for |
Yeah but unlike CookieBuilder, the Handler IS the main thing, so throwing when you set that defeats the whole purpose of exposing that. |
I would go minimal, we can always add the builder later if things get more complicated. |
#391 @PinpointTownes @DamianEdwards