In blazor Web app .net 8 i am using global auto render mode and using the oidc authentication of azure but after authenticatin my menus are gone cant see the links to navigate between pages in my applicatin.

Kuldeep Y 41 Reputation points
2024-04-10T10:22:05.2+00:00

I have Blazor web app in .Net 8 and I am using the OIDC connect flow to authenticate user from azure Entra Id but after authentication I am fetching groups from azure and on behalf of group policy I am showing and hiding the menus in my application but for first time when application load using SSR it see the menus but when it switches on CSR my menus are gone , I can't see menus no longer but when I refresh page menu are appear for 3 sec and then CSR done and menus are no longer appear. how I can fix this, Please Help me.

Thanks in Advance

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,551 questions
Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,575 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,902 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 64,826 Reputation points
    2024-04-10T16:39:01.6033333+00:00

    there is no proper documentation at this point. the issue is blazor server uses cookie authentication and blazor WASM typically uses bearer tokens. You need to add code to pass the server jwt tokens to the client via persistant user state, and a custom authorization provider for the client version.

    see these threads:

    https://github.com/dotnet/aspnetcore/issues/48772

    https://github.com/dotnet/AspNetCore.Docs/issues/29452

    the latest template supports individual accounts. this is has the sample client authentication provider initialized by the server code. you should change the server code to use azure ad authentication.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.