Relative Content

Tag Archive for c#.netblazorblazor-server-side

Getting AccessToken to attach http request in a delegatinghandler to use in IHttpClientFactory In blazor serverside interactive

Im trying to write a blazor app in dotnet 8 that only uses server side interactive rendering. I want to authenticate against Azure tenant. I have the login working correctly, Im just having a hard time figuring out how to attach the correct authorization token to an http client that is making requests to a different dotnet api that is also authenticated against tenant. It understand that the scope that delegating handlers use is different than that of the signalR circuit that is instantiaded when a client accesses the site. I found this article https://learn.microsoft.com/en-us/aspnet/core/blazor/fundamentals/dependency-injection?view=aspnetcore-9.0#access-server-side-blazor-services-from-a-different-di-scope that describes how to get the authentication state from the circuit. Im just having a hard time figuring out how to ge the access token from this.

Does blazor have any unique ID associated with a window session

I’m working on a Blazor server-side app. In some cases, when a user updates a resource, the application will show a toast asking if the user wants to refresh their view (or not) since if you’re in the middle of analyzing something you may not want the refresh to happen just yet.