On the On-behalf-of flows with MSAL.NET, the section titled "How to call OBO" has an example
private async Task AddAccountToCacheFromJwt(IEnumerable<string> scopes, JwtSecurityToken jwtToken, ClaimsPrincipal principal, HttpContext httpContext)
{
if (jwtToken == null)
{
throw new ArgumentOutOfRangeException("tokenValidationContext.SecurityToken should be a JWT Token");
}
UserAssertion userAssertion = new UserAssertion(jwtToken.RawData, "urn:ietf:params:oauth:grant-type:jwt-bearer");
IEnumerable<string> requestedScopes = scopes ?? jwtToken.Audiences.Select(a => $"{a}/.default");
// Create the application
var application = BuildConfidentialClientApplication(httpContext, principal);
// await to make sure that the cache is filled in before the controller tries to get access tokens
var result = await application.AcquireTokenOnBehalfOf(requestedScopes, userAssertion).ExecuteAsync();
}
It looks like the method implementation for BuildConfidentialClientApplication in the example on the page is missing?