Wonder if someone can help me. I want to connect my SPFX web part to a custom web API (being developed in .NET 5).
Given the recent changes to browsers (third party cookies limitations), it seems like the current recommendation is to use MSAL 2.0 (authorization code flow) to authenticate the user with the custom API. Unfortunately, the examples I could find from Microsoft seem to be using the AadHttpClient class which, as far as I know, uses the old ADAL library with the implicit flow (which will cause problems with browsers blocking third-party cookies).
There seems to be a lot of conflicting information out there on this subject. Some people seem to be suggesting that we should start to use authorization code flow as soon as possible (with MSAL 2.0) others ( including Microsoft) seem to be recommending using the AadHttpClient class. Also, the examples that I could find using MSAL 2.0 with SPFX seem to treat the SPFX as an SPA when in fact it isn't (what is the redirect URL in a SPFX application).
I hope the above makes sense. It would be great if I could get the community views on this.