Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

How can i keep the authentication state when dealing with Microsoft Graph API SDK and blazor in InteractiveAuto mode?

$
0
0

my application use Microsoft Graph SDK (Microsoft.Graph) and Blazor on .net 9.The authentication is currently setup to use the Microsoft Authentication on the server side like this:

builder.Services.AddAuthentication(OpenIdConnectDefaults.AuthenticationScheme)                .AddMicrosoftIdentityWebApp(configuration)                    .EnableTokenAcquisitionToCallDownstreamApi(initialScopes)                        .AddMicrosoftGraph(configuration.GetSection("DownstreamApi"))                        .AddDistributedTokenCaches();

My application authentication work when rendered on the server side but not when the state switch to the webassembly mode (client side).

I have try many things, but i cant find the right way to make it work.I know the authentication state do not persist when the render state change, but i dont know what to change to make this work.

In the first, i had try to use the basic authentication with identity then use the Microsoft Graph OpenId to get the token and manage it myself but again, i did not find all information on how to do it.

I have found this documentation that give some information, but i dont know what's the best way...

Do someone can point me to the right dirrection?

Thanks!


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>