I want to use Http.sys to enable windows authentication and use POSTman to send GET request.
I already enter my computer's account and password,but POSTman told me this error.
Having no idea what happened,somebody can tell me the reason?
Configure Windows Authentication in ASP.NET Core
UPDATE
My Purpose
Startup.cs
public void ConfigureServices(IServiceCollection services)
{
services.AddControllers();
services.AddAuthentication(HttpSysDefaults.AuthenticationScheme);
services.AddSwaggerGen(c =>
{
c.SwaggerDoc("v1", new OpenApiInfo { Title = "webwinauth", Version = "v1" });
});
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
app.UseSwagger();
app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "webwinauth v1"));
}
app.UseHttpsRedirection();
app.UseRouting();
app.UseAuthentication();
app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
});
}
Program.cs
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>()
.UseHttpSys(options =>
{
options.Authentication.Schemes =
AuthenticationSchemes.NTLM |
AuthenticationSchemes.Negotiate;
options.Authentication.AllowAnonymous = true;
});;
});
POSTman
Setting about NTLM
ERROR
Error
You cannot use
Http.syswithasp.net coreits not compatible with theASP.NET Core Moduleand can't be used with IIS or IIS Express. You could have a look here if offical document.Note: You could also have a look offical reference here
Hope it would help you.