1
votes

I created .NET Core hosted Blazor webassembly project with identity server using Visual Studio template. Any idea how I should change the configuration if I want the whole Blazor compiled client code to be available only to authenticated users?

Now everyone can access client side app compiled code even if I secure all Blazor routes with [Authorize] because single-page-app is downloaded as a single entity to the browser. I do not want to make compiled code available publicly to users who don't even have access to app.

1
Maybe you can split your app using BlazorLazyLoading lib as this is not yet available in the framework. And secure your file with a custom middleware - agua from mars

1 Answers

1
votes

Move it to a server-side hosting model. This is like any other purely client SPA -your code goes to the client and they can read it.