Description
This example does not seem to work with the .Net 8 Blazor template, i.e. when using the new type of server-interactive rendering.
The reason is that the root App component does not render in user-scope, but rather in some anonymous pre-render scope that you cannot disable. This causes the state container (TokenProvider service) to instantiate once for the App component while a different (user-scoped) instance is created for the consuming component.
Page URL
https://learn.microsoft.com/en-us/aspnet/core/blazor/security/server/additional-scenarios?preserve-view=true&view=aspnetcore-8.0#pass-tokens-to-a-server-side-blazor-app
Content source URL
https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/blazor/security/server/additional-scenarios.md
Document ID
c98be365-408d-7ee6-cb74-14c44d01b0b8
Article author
@guardrex
Description
This example does not seem to work with the .Net 8 Blazor template, i.e. when using the new type of server-interactive rendering.
The reason is that the root App component does not render in user-scope, but rather in some anonymous pre-render scope that you cannot disable. This causes the state container (TokenProvider service) to instantiate once for the App component while a different (user-scoped) instance is created for the consuming component.
Page URL
https://learn.microsoft.com/en-us/aspnet/core/blazor/security/server/additional-scenarios?preserve-view=true&view=aspnetcore-8.0#pass-tokens-to-a-server-side-blazor-app
Content source URL
https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/blazor/security/server/additional-scenarios.md
Document ID
c98be365-408d-7ee6-cb74-14c44d01b0b8
Article author
@guardrex