Search code examples
javascriptauthenticationmicrosoft-graph-apionedrive

Is it possible to authenticate to Microsoft Graph without a server?


I'm trying to create an integration to OneDrive using the Microsoft Graph API. Our app is fully client-side, there's no moving parts on a server, so authentication has to be directly browser to Microsoft.

We have an existing integration with OneDrive that uses the older OneDrive API. That does permit client-flow authentication.

There is an example for AngularJS, but that turns out to require a NodeJS server and have a server-flow authentication, again. NodeJS authentication requires a secret to be passed over, which I obviously can't put in public JS.

I cannot find any examples of authenticating to the graph API without a secret, am I right in saying that client-flow authentication is not supported?

p.s. I have looked at Writing a simple microsoft graph client without using a web server, but this question seems to be asking whether it's possible to make API calls without user interaction, rather than what I'm asking.


Solution

  • If I understand your scenario correctly, you're looking for the implicit grant. I wrote a blog post on using this a while back that might also be helpful.