@AkScript The 403 error that you are seeing when connecting to the SignalR service could be due to a number of reasons. Here are a few things that you can try to debug the issue:
- Check if there are any access policies that are blocking the client from accessing the SignalR service. You can check the access policies for your SignalR service in the Azure portal.
- Try pinging the SignalR service to see if there are any network issues. You can use the
ping
command to check if there are any network issues between your client and the SignalR service. - Enable server-side logging for ASP.NET Core SignalR to get more information about the error. You can enable logging by adding the following code to your
Startup.cs
file:
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
// ...
app.UseEndpoints(endpoints =>
{
endpoints.MapHub<NotificationsHub>("/notificationshub");
});
// Add the following code to enable logging
app.UseSignalR(routes =>
{
routes.MapHub<NotificationsHub>("/notificationshub")
.RequireAuthorization();
});
}
This will enable logging for the SignalR service and you can check the logs to see if there are any errors that are causing the 403 error.