Use Microsoft Graph in a web API with a Blazor Server client
Whereas I have spent a very long day trying and failing to get this working, I do feel like I'm tantalizingly close. In fact I have this example working. The problem is that example uses a WPF client, and for the life of me I can't seem to get the same functionality working in a Blazor Server app.
Here is my scenario: I have a .NET Core 3.1 web API service (i.e. a "Microsoft.AspNetCore.Mvc.ApiController" based on "Microsoft.AspNetCore.Mvc.ControllerBase"). I have a "Blazor Server" client app that is successfully calling the endpoints in the service. I am using Azure AD B2C for authentication, and both of these apps are registered in the same tenant. Everything is working EXCEPT using Microsoft Graph. When I try to use Graph I get a "Microsoft.Identity.Client.MsalServiceException" - "unsupported_grant_type".
I'm stumped. I realize I haven't supplied enough information for anyone to solve the problem, but I don't know Azure B2C / OAuth nearly well enough, so be gentle with me, but ask whatever clarifying questions are necessary.
Thanks a lot in advance!