Kestrel: An anonymous request was received in between authentication handshake requests?

I created an Kestrel Asp.Net core application and tried to host it on a Windows Server (server1). I launch the application using

Browsing http://server1:8008 on server1 works without any error.

However, when browsing http://server1:8008 on a remote machine, it gets the following error?

PS C:\Websites\Portal> .\Blazor.exe --urls http://server1:8008 info: Microsoft.Hosting.Lifetime[0] Now listening on: http://[::]:8008 info: Microsoft.Hosting.Lifetime[0] Application started. Press Ctrl+C to shut down. info: Microsoft.Hosting.Lifetime[0] Hosting environment: Production info: Microsoft.Hosting.Lifetime[0] Content root path: C:\Websites\Portal warn: Microsoft.AspNetCore.HttpsPolicy.HttpsRedirectionMiddleware[3] Failed to determine the https port for redirect. fail: Microsoft.AspNetCore.Authentication.Negotiate.NegotiateHandler[5] An exception occurred while processing the authentication request. System.InvalidOperationException: An anonymous request was received in between authentication handshake requests. at Microsoft.AspNetCore.Authentication.Negotiate.NegotiateHandler.HandleRequestAsync() fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1] An unhandled exception has occurred while executing the request. System.InvalidOperationException: An anonymous request was received in between authentication handshake requests. at Microsoft.AspNetCore.Authentication.Negotiate.NegotiateHandler.HandleRequestAsync() at Microsoft.AspNetCore.Authentication.Negotiate.NegotiateHandler.HandleRequestAsync() at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware midd leware, HttpContext context, Task task) 
3

1 Answer

A bit old, but, the correction for this....

You need to setup SPNs for your application. Once the proper SPN is in place, the issue should go away.

ncG1vNJzZmirpJawrLvVnqmfpJ%2Bse6S7zGiorp2jqbawutJobHJpaGqDdYSOpJysrKKauW6tzWaYp6eerrqwwdJmqZ6ppZrAtXnWmqpmqpWYsqrCxJ1koqZdl7K1w8SepWaZpam1prrTopqarJmku260wKebrKCRoLJuvg%3D%3D