I'm trying to develop an automation using Graph API
and JavaScript
. I have an app registration in Azure Portal with necessary permissions. How can I authenticate in my JavaScript automation using tenant ID
, client ID
and client secret
and call Graph APIs from automation?
Asked
Active
Viewed 41 times
0

noonenine
- 41
- 7
-
Hi, I think you might find a [sample](https://learn.microsoft.com/en-us/azure/active-directory/develop/sample-v2-code?tabs=apptype#samples-and-guides) here. – Tiny Wang Jul 18 '23 at 05:54
1 Answers
0
For your case, you can use the client credentials flow to request the access token then call Graph API. See the link attached. Assumption: Your automation is a serverside daemon that authenticates and calls Graph API on its own
You can also look at this complete sample for exactly your scenario. The sample contains guide and code sample to authenticate using client secret and then call MS graph API.

Danstan
- 1,501
- 1
- 13
- 20