Skip to content

Kestrel Windows Auth is not prompting UN/PW challenge on macOS, when server runs on windows AD. #53675

Open
@sanderaiaots

Description

@sanderaiaots

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

I'm struggling to get windows auth working on Kestler.
It kinda works, but only when clients are windows Chrome or IE browsers. When client in MacOS UN/PW challenge is not prompted.

Expected Behavior

Expected behaviour is that macOS Chrome / Safari would also prompt for username password.

Steps To Reproduce

Setup keslter server running on windows and enable windows auth like:
Main:
builder.Services.AddAuthentication(NegotiateDefaults.AuthenticationScheme).AddNegotiate(); //for my case I want Auth to be executed on specific path of URL app.UseWhen(context => context.Request.Path.StartsWithSegments("/Auth"), specificPathApp => { specificPathApp.UseAuthentication(); // Apply authentication only for this path specificPathApp.UseAuthorization(); });

AuthController:
public class AuthController : Controller { [HttpGet] [Authorize] public ActionResult Index(string? redirect = null) { WindowsIdentity? winIdent = User.Identity as WindowsIdentity; return new ContentResult { Content = "Auth ok, winidentity: name=" + (winIdent?.Name ?? "user not found"), ContentType = "text/plain" }; } }

Exceptions (if any)

No response

.NET Version

8.0.101

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-authIncludes: Authn, Authz, OAuth, OIDC, Bearerinvestigate

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions