Fix mistype

This commit is contained in:
BrennanConroy 2016-04-28 14:07:28 -07:00
parent e7845f3b37
commit 838146c4a9
2 changed files with 15 additions and 8 deletions

View File

@ -22,9 +22,11 @@ namespace MusicStore.Standalone
.UseIISIntegration() .UseIISIntegration()
.UseStartup("MusicStore.Standalone"); .UseStartup("MusicStore.Standalone");
if (string.Equals(builder.GetSetting("server"), "Microsoft.AspNetCore.Server.WebListener", System.StringComparison.Ordinal) if (string.Equals(builder.GetSetting("server"), "Microsoft.AspNetCore.Server.WebListener", System.StringComparison.Ordinal) &&
&& string.Equals(builder.GetSetting("environment") ?? (string.Equals(builder.GetSetting("environment") ??
Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"), "NtlmAuthentication", System.StringComparison.Ordinal)) Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"),
"NtlmAuthentication",
System.StringComparison.Ordinal)))
{ {
// Set up NTLM authentication for WebListener like below. // Set up NTLM authentication for WebListener like below.
// For IIS and IISExpress: Use inetmgr to setup NTLM authentication on the application vDir or // For IIS and IISExpress: Use inetmgr to setup NTLM authentication on the application vDir or

View File

@ -1,3 +1,4 @@
using System;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Microsoft.Net.Http.Server; using Microsoft.Net.Http.Server;
@ -21,12 +22,16 @@ namespace MusicStore
.UseIISIntegration() .UseIISIntegration()
.UseStartup("MusicStore"); .UseStartup("MusicStore");
if (string.Equals(builder.GetSetting("server"), "Microsoft.AspNetCore.Server.WebListener", System.StringComparison.Ordinal) if (string.Equals(builder.GetSetting("server"), "Microsoft.AspNetCore.Server.WebListener", System.StringComparison.Ordinal) &&
&& string.Equals(builder.GetSetting("environment"), "NtlmAuthentication", System.StringComparison.Ordinal)) (string.Equals(builder.GetSetting("environment") ??
{
if (string.Equals(builder.GetSetting("environment") ??
Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"), Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"),
"NtlmAuthentication", System.StringComparison.Ordinal)) "NtlmAuthentication",
System.StringComparison.Ordinal)))
{
// Set up NTLM authentication for WebListener like below.
// For IIS and IISExpress: Use inetmgr to setup NTLM authentication on the application vDir or
// modify the applicationHost.config to enable NTLM.
builder.UseWebListener(options =>
{ {
options.Listener.AuthenticationManager.AuthenticationSchemes = AuthenticationSchemes.NTLM; options.Listener.AuthenticationManager.AuthenticationSchemes = AuthenticationSchemes.NTLM;
}); });