I am developing an Azure static web app using authentication and authorization for Azure Static Web Apps.
This part works very well, my routes
are secured via Azure AD and are only usable for authenticated
users.
Via the /.auth/me
route I can also access the user information (e.g. the user name) in order to show it as "logged in user".
What I want to do now in addition is to access the user's profile photo - the only way to do that (as far as I understood) is to get it from Microsoft Graph - Get profilePhoto.
That API however requires an OAuth2.0 access token.
This access token however is not accessible in the Azure Static Web App, using the built-in "authentication and authorization" mechanism linked above.
How can my application now authenticate at the "Microsoft Graph" API without the need of initiating an additional OAuth2.0 code flow (just for getting the profile photo)?
Is the access_token e.g. accessible anywhere (in frontend or backend of the Azure SWA)?