-
Notifications
You must be signed in to change notification settings - Fork 841
Description
Describe the issue
We are using Blazor Web App with only InteractiveWebAssembly (because of some limitations of external components we use) and we authenticate through OpenIdConnect.
We want to use the BFF pattern as explained in the documentation.
However, there is no sample for only InteractiveWebAsssembly, so we started with the BlazorWebAppOidcBffAuto sample and removed the .AddInteractiveServerComponents()
Locally on our development machines this all seemed to work fine, but once we deploy our application on our Kubernetes cluster we start running into issues.
- The logout (authentication/logout) doesn't work, the page returns a 500:
StatusCode: 500, BodyAsText: This form is being accessed with an invalid anti-forgery token. Validate the `IAntiforgeryValidationFeature` on the request before reading from the form.
- After x amount of time, it seems like the frontend 'forgets' your authentication. All the [Authorize] attributes return an unauthorized, and getting items from the claims
await AuthenticationStateProvider.GetAuthenticationStateAsync();returns nothing.
To Reproduce
Steps to reproduce the behavior:
- Adjust the BlazorWebAppOidcBffAuto sample to only be InteractiveWebAssembly.
- Deploy the application through:
dotnet publish "${PROJECT}.csproj" -c Release -p RuntimeIdentifier=linux-x64 - Try to authentication/logout endpoint.
Additional context
- DOTNET 10
Is InteractiveWebAssembly not supported with the sample codes, or there any different changes we need to do?
Issue Details
⚠ Do not edit this section. It is required for issue processing.
- Content Source: dotnet/blazor-samples
- GitHub Login: @guardrex