Skip to content

BlazorWebAppOidcBffWebAuto, but with only InteractiveWebAssembly? #642

@Schoof-T

Description

@Schoof-T

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:

  1. Adjust the BlazorWebAppOidcBffAuto sample to only be InteractiveWebAssembly.
  2. Deploy the application through: dotnet publish "${PROJECT}.csproj" -c Release -p RuntimeIdentifier=linux-x64
  3. 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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions