RESTful web API that enables you to access Microsoft Cloud service resources. For daemon applications, it uses the standard OAuth 2.0 client credentials grant.
Go to siteimport { axios } from "@pipedream/platform"
export default defineComponent({
props: {
microsoft_graph_api_daemon_app: {
type: "app",
app: "microsoft_graph_api_daemon_app",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://graph.microsoft.com/v1.0/users`,
headers: {
Authorization: `Bearer ${this.microsoft_graph_api_daemon_app.$auth.oauth_access_token}`,
},
})
},
})
Microsoft Graph API (daemon app) uses OAuth authentication. When you connect your Microsoft Graph API (daemon app) account, Pipedream will open a popup window where you can sign into Microsoft Graph API (daemon app) and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Microsoft Graph API (daemon app) API.
Pipedream requests the following authorization scopes when you connect your account:
https://graph.microsoft.com/.default
POST
https://login.microsoftonline.com/{{custom_fields.tenant_id}}/oauth2/v2.0/token
content-type: application/x-www-form-urlencoded
client_id={{custom_fields.client_id}}
&
client_secret={{custom_fields.client_secret}}
&
grant_type=client_credentials
&
scope={{oauth.space_separated_scopes}}
POST
https://login.microsoftonline.com/{{custom_fields.tenant_id}}/oauth2/v2.0/token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{custom_fields.client_id}}
&
client_secret={{custom_fields.client_secret}}
&
grant_type=client_credentials
&
scope={{oauth.space_separated_scopes}}