# What is Blazor? A Tutorial on Building Web Apps with Authentication

**URL:** <https://community.auth0.com/t/what-is-blazor-a-tutorial-on-building-web-apps-with-authentication/33611>\
**Category:** Get Help\
**Tags:** dotnet, net-core, aspnet-core, .net, blazor\
**Created:** [November 11, 2019, 2:56pm UTC](https://community.auth0.com/t/what-is-blazor-a-tutorial-on-building-web-apps-with-authentication/33611 "2019-11-11T14:56:06Z")\
**Posts on this page:** 1\
**Showing post:** 159

<div class="post-metadata">

**Author:** ![cellaret](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/cellaret/32/46799_2.png) [@cellaret](https://community.auth0.com/u/cellaret)\
**Post date:** [May 3, 2023, 8:51pm UTC](https://community.auth0.com/t/what-is-blazor-a-tutorial-on-building-web-apps-with-authentication/33611/159 "2023-05-03T20:51:28Z")

</div>

This was fairly straightforward and I got it redirecting to my Blazor page endpoint `/auth0`, but now I am getting an odd `OpenIdConnectAuthenticationHandler` exception. It reads:

```auto
An unhandled exception occurred while processing the request.
Exception: OpenIdConnectAuthenticationHandler: message.State is null or empty.
Unknown location

Exception: An error was encountered while handling the remote login.
Microsoft.AspNetCore.Authentication.RemoteAuthenticationHandler<TOptions>.HandleRequestAsync()

Stack Query Cookies Headers Routing
Exception: OpenIdConnectAuthenticationHandler: message.State is null or empty.

Show raw exception details
System.Exception: OpenIdConnectAuthenticationHandler: message.State is null or empty.
Exception: An error was encountered while handling the remote login.
Microsoft.AspNetCore.Authentication.RemoteAuthenticationHandler<TOptions>.HandleRequestAsync()
Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)

Show raw exception details
System.Exception: An error was encountered while handling the remote login.
 ---> System.Exception: OpenIdConnectAuthenticationHandler: message.State is null or empty.
   --- End of inner exception stack trace ---
   at Microsoft.AspNetCore.Authentication.RemoteAuthenticationHandler`1.HandleRequestAsync()
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)

```

I’ve tried both a Blazor component/page and a .CSHTML page (with model) and both give the same error. Is there something extra that needs to be added to the `Startup.cs` class to make this work?

I’ve even tried adding the following to my `Startup.cs` class with no effect:

```auto
builder.Services.AddHttpContextAccessor();

```

The code for my callback doesn’t even reach the breakpoint shown:

 ![Screenshot 2023-05-03 at 3.49.22 PM](https://global.discourse-cdn.com/auth0/original/3X/4/b/4b1e0f00961cd8f2e6454b62769312328edc174e.png)

Thoughts?

---

_[View the full topic](https://community.auth0.com/t/what-is-blazor-a-tutorial-on-building-web-apps-with-authentication/33611)._
