Hello,
encountered the same issue. Did someone find a solution for this problem and would like to share this?
Can't find the root cause of this exception...
Kind regards,
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I want to implement two authentication mechanism in my Blazor web assembly application (Azure AD and Custom Authentication). i.e. User can either login via Azure AD or he can go for Custom Authentication. When I register both Custom AuthenticationStateProvider and AddMsalAuthentication in program.cs and try to login via AAD that time I am getting below error.
crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
Unhandled exception rendering component: Specified cast is not valid.
System.InvalidCastException: Specified cast is not valid.
at Microsoft.Extensions.DependencyInjection.WebAssemblyAuthenticationServiceCollectionExtensions.<>c__0`3[[Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationState, Microsoft.AspNetCore.Components.WebAssembly.Authentication, Version=5.0.8.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteUserAccount, Microsoft.AspNetCore.Components.WebAssembly.Authentication, Version=5.0.8.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[Microsoft.Authentication.WebAssembly.Msal.Models.MsalProviderOptions, Microsoft.Authentication.WebAssembly.Msal, Version=5.0.8.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].
Hello,
encountered the same issue. Did someone find a solution for this problem and would like to share this?
Can't find the root cause of this exception...
Kind regards,
I'm getting the same error, but I'm doing OIDC authentication. It works fine in a template app where you run dotnet new blazorwasm --auth individual
. But when I port the code over to my big app, I get this. I'm not sure where to look to figure out the problem. I'm using dotnet 6.0.112. I'll report back if I figure anything out.
Having the same exact issue with the same situation. Did anyone ever come up with a solution or even what the cause was?
I have the same issue. does anyone have any solution or I am happy with alternative solution too.