To integrate SF with PowerBI we first need to get an access token from Azure AD with the powerBI scope. I am able to set up a named credential (per user) which connects to Azure AD, I am able to reuse the {!credential.OAuthToken} in subsequent requests I used for testing purposes. However, is there a way to actually store this OAuthToken in a variable in apex to return it to my LWC? The PowerBI.js library needs the Azure AD token explicitly to embed a report, so my idea was to return it by my apex controller.
Another option is to not use named credentials and perform the OAuth2 handshaking myself but this brings additional complexity and work.
Any hints are appreciated at this point.