I've got a Blazor InteractiveAuto project where the client communicates to the server through GRPC. In the Blazor client, I have a GRPC client. In the ASP.Net server, I have a GRPC server and client. Under server-side rendering, the server is communicating with itself through GRPC.
Upon adding OIDC and cookie authentication, I noticed that the user authentication works as expected with client-side rendering, but isn't passed along during server-side rendering. I tried to create a dummy GRPC client that directly calls the ServiceBase methods, but HttpContextServerCallContext is internal, so I don't see how I can construct the ServerCallContext parameter.
Do I have to change my entire authentication scheme or is there a better way to make GRPC work with InteractiveAuto projects with user authentication? I'm hoping that there is some straight-forward way with AddCallCredentials that I'm not seeing.
I solved the problem by passing the cookies from the incoming request to the server-side HttpClient used in the GRPC client.