SOLVED

Best example for getting the Graph API bearer token in SPFX?

Silver Contributor

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.

 

1 Reply
best response confirmed by VI_Migration (Silver Contributor)
Solution
https://dev.office.com/sharepoint/docs/spfx/web-parts/guidance/call-microsoft-graph-from-your-web-pa... 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.
1 best response

Accepted Solutions
best response confirmed by VI_Migration (Silver Contributor)
Solution
https://dev.office.com/sharepoint/docs/spfx/web-parts/guidance/call-microsoft-graph-from-your-web-pa... 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.

View solution in original post