When trying "Run user flow" in Azure ADB2C on Azure platform it throws: "OpenIdConnectAuthenticationHandler: message.State is null or empty"
I created .NET8 Web app using Azure ADB2c authorization based on this tutorial: Configure authentication in a sample web app by using Azure AD B2C
Log-in, log-out, showing claims works nicely both when I run it locally in Visual Studio as well as after deploying it on Azure Services.
However, when in Azure portal I go to: "ADB2C -> User flows" and click on "Run user flow" and then select "Reply URL" corresponding to version deployed on Azure Service
application displays an error: "OpenIdConnectAuthenticationHandler: message.State is null or empty." but it logs me in, as shown on below screen:
Reply URL in ADB2C: https://adb2clogin23121979webapp.azurewebsites.net/signin-oidc App URL: https://adb2clogin23121979webapp.azurewebsites.net/ Configuration in my application: application.json
{
"AzureAdB2C": {
"Instance": "https://contosoorg23121979.b2clogin.com",
"ClientId": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"Domain": "xxxxx.onmicrosoft.com",
"SignedOutCallbackPath": "/signout/B2C_1_SingInUp",
"SignUpSignInPolicyId": "B2C_1_SingInUp",
"ResetPasswordPolicyId": "B2C_1_ResetPassword",
"EditProfilePolicyId": "B2C_1_ProfileEdit"
}
}
Startup.cs
public void ConfigureServices(IServiceCollection services)
{
services.Configure<CookiePolicyOptions>(options =>
{
options.CheckConsentNeeded = context => true;
options.MinimumSameSitePolicy = SameSiteMode.Unspecified;
options.HandleSameSiteCookieCompatibility();
});
services.AddMicrosoftIdentityWebAppAuthentication(Configuration, Constants.AzureAdB2C);
services.AddControllersWithViews().AddMicrosoftIdentityUI();
services.AddRazorPages();
services.AddOptions();
services.Configure<OpenIdConnectOptions>(Configuration.GetSection("AzureAdB2C"));
}