Using the Microsoft Graph API JavaScript SDK with App Permissions

Introduction Recently, I wanted to use the Microsoft Graph JavaScript SDK within my Node app. If you are familiar with the SDK, you will know that it will not obtain its own access token - you need to use an authentication provider and feed that to the SDK client. Typically, with browser-based authentication you would authenticate as the user and use something like the implicit grant method with a library such as MSAL. However, for server-side applications (with no user interaction) you will want to use application permissions and the client credentials method/flow. When using application permissions, you will need to use a Tenant ID, App ID and Secret of your Azure AD Application. In addition, you will need Graph permissions granted to the application. The Graph docs example for the this method when using the Graph SDK states you need to create your own authentication provider: ...

October 5, 2020 · Lee Ford