Search code examples
.netvisual-studioauthenticationwebassembly

Blazor Webassembly - sign in dialog on published app


Running my blazor wasm from visual studio works fine, but when I deploy I get the sign in dialog on the published app on initial load.

The application should support anonymous access in addition to authenticated access, and this works fine running in debug. Why do I get the dialog on the published version? For authenticated pages, the log in is handled by IDP (duende).

enter image description here

The app.razor looks like this

<CascadingAuthenticationState>
    <Router AppAssembly="@typeof(App).Assembly">
        <Found Context="routeData">
            <RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
            <FocusOnNavigate RouteData="@routeData" Selector="h1" />
        </Found>
        <NotFound>
            <PageTitle>Not Found</PageTitle>
            <LayoutView Layout="@typeof(MainLayout)">
                <p role="alert">Sorry, this page does not exists!</p>
            </LayoutView>
        </NotFound>
    </Router>
</CascadingAuthenticationState>

Solution

  • The issue was related to my webserver. Disabled integrated windows authentication, and it worked as expected.