Azure Active Directory B2C

Hello Radzen Team!

I've been working on a proof of concept of connecting a Radzen Blazor application to AD B2C following this documentation on the site: Azure AD B2C Support

I've also followed the steps on a Blazor Train episode about setting up B2C in Azure (for reference: Adding Azure AD B2C to an existing Blazor app: Carl Franklin's Blazor Train ep 28 - YouTube). This has a pretty decent breakdown of how to setup B2C and Azure and how to connect with a Blazor app.

I've filled out the security screen in Radzen as needed with all the necessary B2C parameters, added a blank page and set the authorization on it.

Launching the app forwards me correctly to the B2C login page, I can create a new account or login. Once I successfully login and am forwarded back to the Radzen application, I receive the following general error:


An error occurred while processing your request.

Request ID: 00-15baf2a9497f5950bc5cec59901db4dc-9f1b939c8a2787a8-00

Development Mode

Swapping to Development environment will display more detailed information about the error that occurred.

Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application.

I've tried to start the application via dotnet run with setting the mentioned environment variable above to Development, but I still get the same output. I've checked the console output in Radzen and I don't see any errors, but there's some information that looks suspect:

dotnet: warn: Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler[15]
      '.AspNetCore.Correlation.cylEg-F1SsFKvoyC-cJSHUaMGfYUUrQy_0vSaU2nPSU' cookie not found.
info: Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler[4]
      Error from RemoteAuthentication: Correlation failed..

dotnet: info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished HTTP/1.1 POST https://localhost:5001/signin-oidc application/x-www-form-urlencoded 1552 - 302 0 - 41.1375ms

dotnet: info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/1.1 GET https://localhost:5001/MicrosoftIdentity/Account/Error - -

dotnet: info: Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler[7]

dotnet:       OpenIdConnect was not authenticated. Failure message: Not authenticated
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
      Executing endpoint '/Account/Error'

dotnet: info: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[3]
      Route matched with {page = "/Account/Error", area = "MicrosoftIdentity", action = "", controller = ""}. Executing page /Account/Error

dotnet: info: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[105]
      Executing handler method Microsoft.Identity.Web.UI.Areas.MicrosoftIdentity.Pages.Account.ErrorModel.OnGet - ModelState is Valid

dotnet: info: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[108]
      Executed handler method OnGet, returned result .
info: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[107]
      Executing an implicit handler method - ModelState is Valid
info: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[109]
      Executed an implicit handler method, returned result Microsoft.AspNetCore.Mvc.RazorPages.PageResult.

dotnet: info: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[4]
      Executed page /Account/Error in 19.9839ms
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
      Executed endpoint '/Account/Error'

dotnet: info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished HTTP/1.1 GET https://localhost:5001/MicrosoftIdentity/Account/Error - - - 200 - text/html;+charset=utf-8 29.5894ms
type or paste code here

Any feedback on this would be great. Thank you!

Unfortunately we have not seen this problem before. You can try setting up Azure AD B2C with the built-in template and see if it works correctly there. Also make sure you are using HTTPS to access your app.

Thanks, @korchev ... After reviewing that Microsoft Doc, I was able to walk-through the Azure setup side and ensure that the settings were correct. Seems to be working now in my testing.