OpenIdConnectAuthenticationHandler: message.State is null or empty.

Shripad Godse 25 Reputation points
2023-12-14T09:17:00.45+00:00

I have a multi-tenant application in Microsoft Entra ID, which I use for Single Sign-On in my .NET 6 (API) and Angular 7 application as shown in the attached screenshots.

There are two issues I'm facing:

  1. After updating from .NET 3.1 to 6, I'm not able to log in using SSO on my local machine. I suspect this may be due to a proxy server change, but I'm not sure how to debug this issue properly.
  2. When I click on my application in the My App section of Office apps, I am getting an exception message (this is not related to updating .NET version). The exception message is:

System.Exception: An error was encountered while handling the remote login. ---> System.Exception: OpenIdConnectAuthenticationHandler: message.State is null or empty.

Implementation:

Startup.csScreenshot 2023-12-13 185146

Controller:

User's image

My App from microsoft app section:

User's image

Developer technologies ASP.NET ASP.NET Core
Microsoft Security Microsoft Entra Microsoft Entra ID
{count} vote

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.