Im building my first Blazor WASM (Client and Server) app in .NET5 and having troubles with the authentication. My goal is to not use Identity since I don't want to use localstorage and only have a JWT (or similar) cookie authentication like this picture: Chrome DevTools.
I have tried to use the
services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme).AddCookie( ... )
on server side but then Im getting an error saying
There is no registered service of type 'Microsoft.AspNetCore.Components.Authorization.AuthenticationStateProvider'..
I got no error with
builder.Services.AddOidcAuthentication
in the Client's Program.cs but the app did not authorized me after I logged in (I got a token in my cookies).
I feel like I have tried every Microsoft Docs and tutorials out there but with no luck so if someone have a solution to this it would be very appreciated!