ASP.NET Core 6 Server authorization - Having trouble with authorization

Dennis Tabako 36 Reputation points
2022-04-18T21:11:41.673+00:00

Hi,

I have an ASP.NET Core 6 application that serves as both a server and a client (aggregates data from various machines and serves data to a client). It needs Windows authentication for certain functionality so I have set that up. It also uses SignalR for certain functionality. The problem I have is this: my application needs Windows Authentication set to true in launchsettings.json. If I set also Anonymous Authentication to true on the aggregating server, I can take calls from Postman and the application deployed to the aggregated machines. But then SignalR can't make the connection between the web client and the aggregating server (InvalidOperationException - No authentication scheme specified). If I set Anonymous Authentication to false, SignalR is happy but Postman and my aggregated-machine app get 401.2 (unauthorized) when trying to call into the aggregating server. Is there any way to resolve this so both can work?

Thanks,
Dennis

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,199 questions
{count} votes