"Securing Blazor WebAssembly Apps" tutorial does not work on IIS

I tried this tutorial and confirmed that it works fine in Visual Studio debugging. However, when I deploy to IIS, I get a 500 Internal Server Error as shown below. It looks like I can’t access the protected API.

Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
      Unhandled exception rendering component: net_http_message_not_success_statuscode, 500, Internal Server Error
System.Net.Http.HttpRequestException: net_http_message_not_success_statuscode, 500, Internal Server Error
   at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
   at System.Net.Http.Json.HttpClientJsonExtensions.<GetFromJsonAsyncCore>d__13`1[[System.Collections.Generic.List`1[[QuizManagerClientHosted.Shared.QuizItem, QuizManagerClientHosted.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext()
   at QuizManagerClientHosted.Client.Pages.QuizViewer.OnInitializedAsync()
   at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task , ComponentState )

The IIS website is configured with ‘https://localhost:8081’, and the Auth0 application’s ‘Allowed Callback Urls’ and ‘Allowes Logout Urls’ are set.

I can log in and log out, but when I clicked “Quiz” on the menu, an error occured and the message “Loading” remained displayed.

Environment:
Windows 10 21H2
.NET 6
Visual Studio 2022 Ver. 17.7.5

I can imagine how you must have felt when you saw that the tutorial “Securing Blazor WebAssembly Apps” was not working on IIS. I can remember one such instance where I was working on an assignment help project where I wasted so much time trying to troubleshoot my configuration in IIS, testing application pool settings and whether the version of.NET was updated as well. If you get specific errors, then feel free to share them with me since sometimes a fresh perspective is all we need to realize what we are missing. Now, just let’s do this step by step, exactly how I did when I finally managed to get my application going for my assignment help!