Sample implementing reference token support, token exchange, impersonation and delegation and enhanced client authentication with private key JWTs (both for client credentials and code + PKCE flows)
You can find a PPTX with some additional explanation in the root folder.