Forum Discussion
Brent Ellis
Aug 28, 2017Silver Contributor
Best example for getting the Graph API bearer token in SPFX?
What is the best solution that currently shows how to get the Graph API bearer token from a SharePoint SPFX app?
ADAL.JS doesnt work in the modern Script Editor Web Part by Mikael Svenson
I want to hopefully re-use my existing Javascript Graph API functions, i just need the best way to get the bearer token, and then muddle through working in my existing functions.
- https://dev.office.com/sharepoint/docs/spfx/web-parts/guidance/call-microsoft-graph-from-your-web-part or if you can make due with access via Group. permissions, then use GraphHttpClient.
The other option is a server side component to either do ADAL on users behalf, or use app tokens if that works for your scenario.
- Mikael SvensonSteel Contributorhttps://dev.office.com/sharepoint/docs/spfx/web-parts/guidance/call-microsoft-graph-from-your-web-part or if you can make due with access via Group. permissions, then use GraphHttpClient.
The other option is a server side component to either do ADAL on users behalf, or use app tokens if that works for your scenario.