.NET Blazor App and Auth0

Ready to post? :mag: First, try searching for your answer.

I’ve a Blazor Server App in .NET8, I’ve following the standard configuration to use Auth0 :

services.AddAuth0WebAppAuthentication(options =>
{
options.Domain = builder.Configuration[“Auth0:Domain”] ?? string.Empty;
options.ClientId = builder.Configuration[“Auth0:ClientId”] ?? string.Empty;
options.Scope = “openid profile email”;
});

It works very well in another project, but in a new one I’ve this error :

An unhandled exception occurred while processing the request.

InvalidOperationException: Cannot redirect to the authorization endpoint, the configuration may be missing or invalid.

Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler.HandleChallengeAsyncInternal(AuthenticationProperties properties)

Someone can help ?

Double check the values in your appsettings.json. Also, make sure you set the Application URIs in the dashboard for your application. The Allowed Callback URL should be in the format of https://yourappdomain/callback.

1 Like

Hello I finally resolve this problem by doing this :
image
I’ve installed and update manually all the nuget packages below Auth0.AspNetCore.Authentication and it works. The Auth0 nuget package version 1.4.1 is not updated with the last packages of OpenId and it could generate some problem.