Active Directory in .NET Core 5

Viewed 26

I am trying to set up user authentication by AD.

This is what I have in the launchsettings file:

"windowsAuthentication": true,
"anonymousAuthentication": false,

and that's what I have in startup:

services.AddAuthentication(NegotiateDefaults.AuthenticationScheme)
   .AddNegotiate();
       
services.AddAuthorization(options =>
        {
            options.FallbackPolicy = options.DefaultPolicy;
        });

app.UseHttpsRedirection();
app.UseAuthentication();
app.UseAuthorization();
app.UseRouting();

and it does not work.

What else should I do to make it work?

0 Answers
Related