Use Microsoft Graph API with OAuth 2.0 client credentials grant flow in Deno
Microsoft Graph API client in Deno, with authentication via OAuth 2.0 client credentials grant flow.
Uses @microsoft/microsoft-graph-client under the hood.
See https://www.npmjs.com/package/@microsoft/microsoft-graph-client for usage of client.
TENANT_ID, CLIENT_ID and CLIENT_SECRET environment variables in .env// example.ts
import { client } from "https://raw.githubusercontent.com/RihanArfan/deno-microsoft-graph/v1.0.0/client.ts";
import type { User } from "npm:@microsoft/microsoft-graph-types";
const users: User[] = await client.api("/users").get();
console.log(users);
deno run --allow-env --allow-net --allow-read --allow-sys example.ts
Client for init which accepts tenantId, clientId and We use cookies
We use cookies to analyze traffic and improve your experience. You can accept or reject analytics cookies.