Nov 14 2018 02:53 AM
Hello,
I am trying to develop a new SharePoint add-in (SharePoint hosted), that needs to use JavaScript to connect to Microsoft Graph API. Since it is use for Office Store, it should not use SharePoint Framework (SPFX).
Any idea how to handle authentication (ADAL/MSAL ?) for graph.microsoft.com from such a SP add-in ? and is it possible at all?
Nov 14 2018 06:39 AM
Hi Hrvoje,
Are you able to use PnPJs? You can use that outside SPFx
https://github.com/pnp/pnpjs/blob/dev/packages/graph/docs/index.md
Nov 14 2018 06:44 AM
It seems that following link is just dependent on SharePoint Framework (spfx) which I can not use, since it does not support putting app on SharePoint Store ...
Nov 14 2018 06:52 AM - edited Nov 14 2018 06:55 AM
It actually isn't dependent on SPFx but SPFx makes certain operations easier.
You can use PnPJs from a NodeJS app, for example, and authenticate via ADAL to Graph or SharePoint REST APIs.
Not sure if it helps the specifics of your situation, but you can definitely use it outside of SPFx.
https://pnp.github.io/pnpjs/common/docs/adalclient/#manually-configure
May 24 2019 06:35 AM
@Thomas Berman in that case it is to complex situation then for me, but tanks for the info :)