.NET core 7 windows authentication exception when deployed

37 Views Asked by At

I have an .NET core application that uses windows authentication. Locally it works fine. However when application is deployed to an openshift platform I get this error after trying to sign in.

An unhandled exception occurred while processing the request.
AuthenticationException: GenericFailure
Microsoft.AspNetCore.Authentication.Negotiate.NegotiateHandler.HandleRequestAsync()

    AuthenticationException: GenericFailure
Microsoft.AspNetCore.Authentication.Negotiate.NegotiateHandler.HandleRequestAsync()
Microsoft.AspNetCore.Authentication.Negotiate.NegotiateHandler.HandleRequestAsync()
Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)

In my Program.cs I use generic rules for windows auth, nothing fancy:

builder.Services.AddAuthentication(NegotiateDefaults.AuthenticationScheme)
    .AddNegotiate();

builder.Services.AddAuthorization(options =>
{
    // By default, all incoming requests will be authorized according to the default policy.
    options.FallbackPolicy = options.DefaultPolicy;
});

app.UseAuthentication();
app.UseAuthorization();

Looked everywhere for a possible solution but I was unable to find it so I'm now desperate enough to ask here.

0

There are 0 best solutions below