Skip to content

Windows Authentication Error using Kestrel for .NET Core Web API, when accessed remotely. #20540

Open
@Yustos

Description

@Yustos

Error in Windows Authentication using Kestrel still reproduce (package Microsoft.AspNetCore.Authentication.Negotiate, guide https://docs.microsoft.com/ru-ru/aspnet/core/security/authentication/windowsauth?view=aspnetcore-3.1&tabs=visual-studio#kestrel).
Same error in related issue. But i collected logs and prepare example to reproduce bug.

Example in branch: https://github.com/Yustos/AspNetCoreSubdomain/commits/auth_trouble
Reproduce steps:

  • Compile AspNetCoreSubdomain.Samples.csproj
  • Place bin folder to remote server (example.com)
  • Run on remote server AspNetCoreSubdomain.Samples.exe in console
  • On local computer open http://example.com:5000 in chrome browser

You can see error 404 in browser and this topic error in log.
Or you can try postman get query with NTLM auth - there will be 401 error and same error in server log.

In the fiddler all three negotiate requests exists, bug without success:
№ Result Protocol Host URL Body Caching Content-Type Process Comments Custom
7 401 HTTP example.com:5000 / 0 postman:119596
8 401 HTTP example.com:5000 / 0 postman:119596
9 401 HTTP example.com:5000 / 0 postman:119596

There is connection log, as you ask:
auth_log.txt

Remark: i replaced server name to example.com and username from domain to Yustos in attached log.

At last, i was tried HTTP.SYS auth (see commented code in example branch Yustos/AspNetCoreSubdomain@d39dd1f) - it work fine.

I followed auth example prepare by this guide on windows (client and server): https://docs.microsoft.com/ru-ru/aspnet/core/security/authentication/windowsauth?view=aspnetcore-3.1&tabs=visual-studio#kestrel
Except setspn command: https://docs.microsoft.com/ru-ru/aspnet/core/security/authentication/windowsauth?view=aspnetcore-3.1&tabs=visual-studio#windows-environment-configuration

Metadata

Metadata

Assignees

No one assigned

    Labels

    ExternalThis is an issue in a component not contained in this repository. It is open for tracking purposes.affected-fewThis issue impacts only small number of customersarea-authIncludes: Authn, Authz, OAuth, OIDC, BearerblockedThe work on this issue is blocked due to some dependencyseverity-minorThis label is used by an internal tooltask

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions