get an access token for microsoft graph api using javascript

Solutions on MaxInterview for get an access token for microsoft graph api using javascript by the best coders in the world

showing results for - "get an access token for microsoft graph api using javascript"
Max
26 Oct 2019
1const postData = {
2  client_id: APP_ID,
3  scope: MS_GRAPH_SCOPE,
4  client_secret: APP_SECERET,
5  grant_type: 'client_credentials'
6};
7
8axios.defaults.headers.post['Content-Type'] =
9  'application/x-www-form-urlencoded';
10
11axios
12  .post(TOKEN_ENDPOINT, qs.stringify(postData))
13  .then(response => {
14    console.log(response.data);
15  })
16  .catch(error => {
17    console.log(error);
18  });