Documentation / tutorial on securing a Blazor Server App with Auth0

Documentation / tutorial on securing a Blazor Server App with Auth0

I have been following this tutorial on Blazor Wasm:

It would be extremely useful to have the same but for Blazor Server

There are a lot of C# developers starting to develop Blazor Server apps to replace legacy line of business applications. The documnetation for this using Azure B2C is very poor. You could make Auth0 the goto authentication method for Blazor Server

Hey there!

Thanks for creating this feedback card. Let’s see who else from community will be interested in such addition!

4 Likes

I am new to Auth0. Has there been any tutorials or examples created for Blazor Server?

Sorry, I use the exact same method on WASM logout and .net 7.0 in two places. It still log out twice sometimes
Can you suggest what is wrong with my code?
Thanks.

private void BeginSignOut(MouseEventArgs args)
{
Task.Run(async () => JSRuntime.InvokeVoidAsync(“sessionStorage.clear()”));
Navigation.NavigateToLogout(“authentication/logout”);
}

@{ var authority = (string)Configuration["Auth0:Authority"]; var clientId = (string)Configuration["Auth0:ClientId"]; Task.Run(async () => JSRuntime.InvokeVoidAsync("sessionStorage.clear()")); Navigation.NavigateToLogout($"{authority}/v2/logout?client_id={clientId}"); }